[Mono-bugs] [Bug 698973] New: Garbage collector prematurely collects objects
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Thu Jun 9 04:08:22 EDT 2011
https://bugzilla.novell.com/show_bug.cgi?id=698973
https://bugzilla.novell.com/show_bug.cgi?id=698973#c0
Summary: Garbage collector prematurely collects objects
Classification: Mono
Product: MonoTouch
Version: unspecified
Platform: x86-64
OS/Version: Mac OS X 10.6
Status: NEW
Keywords: Reliability
Severity: Critical
Priority: P5 - None
Component: Runtime
AssignedTo: mono-bugs at lists.ximian.com
ReportedBy: vittorio.monaco at merqurio.it
QAContact: mono-bugs at lists.ximian.com
Found By: Customer
Blocker: No
Description of Problem:
Application crashes on start. Debugging the code shows that elements of a List
are prematurely collected, even if the reference to the List is still being
used.
Using MonoTouch 3.2.6 this does not happen, anyway I have to upgrade to
MonoTouch 4.0.3
The code is below:
List<MerqurioMenuNode> rootMenu = MenuManager.GetRootMenu();
the next debugging step already shows the list with the correct elements count,
but drilling down the elements shows the message 'The requested operation
cannot be completed because the object has been garbage collected'
The method is below:
public List<MerqurioMenuNode> GetRootMenu()
{
XmlNodeList nodes = rootNode.ChildNodes;
currentNodes.Clear();
Livello=0;
Nonno=0;
Bisnonno=0;
Padre=0;
StackNonno.Push(Nonno);
StackBisnonno.Push(Bisnonno);
for (int i = 0; i < nodes.Count; i++)
{
tmp = GetMerqurioMenuNodeFromXmlNode(nodes[i]);
tmp.ParentMenuID = 0;
tmp.Direction = NodeDirection.Forward;
currentNodes.Add(tmp);
}
return currentNodes;
}
every relevant variable except for nodes (currentNodes, rootNode, tmp) is
declared static in the class, so for what I can see there are no elements for
the gc to collect the list items.
Steps to reproduce the problem:
1. Execute the code
2. The next debugging step already shows the items as collected
Actual Results:
The application crashes on startup
Expected Results:
The items should be reachable
How often does this happen?
Always
Additional Information:
The project is a iPad Window-based project
(MonoDevelop 2.4.2)
(MonoTouch 4.0.3)
(SnowLeopard 10.6.7)
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the mono-bugs
mailing list