473,398 Members | 2,165 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Dispose, Finalizer, = null, Dead references

I have a form derived mdi child with a private field that holds the
instance of a business class. As i noticed, this business object stays
until the program (which in fact is the parent form) exits, no matter
how many times i call GC.Collect(). if i explicitly call
"m_businessObject = null" in the Dispose() override, it seems to work,
but that can't be right to explicitly set references of managed
classes to null in the dispose method? The class itself in that case
was never even references somewhere (besides in a weakreference[] list
to test it). seems to be no difference in debug and release mode. any
suggestions?

Thx in advance,
Daniel K
Nov 16 '05 #1
3 1342
Is there any way to trace the object's graph and find out why the object
still is still in it?

"Daniel Jin" <Da*******@discussions.microsoft.com> schrieb im Newsbeitrag
news:FA**********************************@microsof t.com...
well, if an object is reachable in the object graph, (in your case, a

private field of a long lived form), it's not garbage, and it won't be
collected.
Nov 16 '05 #2
Finally i found it out after giving a try to "Memory Profiler". When a
control on any page was databound, that however causes a graph to the
DataSource it is bound to. hopefully it will be fixed in a future
version. absolutely relying on a prober reset of the databinding
controls in the dispose function kind a scares me.

"ViperDK \(Daniel K.\)" <No**********************@gmx.net> wrote in message news:<cd*************@news.t-online.com>...
Is there any way to trace the object's graph and find out why the object
still is still in it?

Nov 16 '05 #3
Finally i found it out after giving a try to "Memory Profiler". When a
control on any page was databound, that however causes a graph to the
DataSource it is bound to. hopefully it will be fixed in a future
version. absolutely relying on a prober reset of the databinding
controls in the dispose function kind a scares me.

"ViperDK \(Daniel K.\)" <No**********************@gmx.net> wrote in message news:<cd*************@news.t-online.com>...
Is there any way to trace the object's graph and find out why the object
still is still in it?

Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: faktujaa | last post by:
Hi All, A small confusion. I have defined a connection class that has System.Data.IDbConnection as a member variable and implements IDisposable interface. I have implemented Dispose method to call...
11
by: Ken Durden | last post by:
I am in search of a comprehensive methodology of using these two object cleanup approaches to get rid of a number of bugs, unpleasantries, and cleanup-ordering issues we currently have in our...
6
by: TB | last post by:
I understand the basics of finalization and implementing IDisposable and how one is guaranteed access to managed objects only when working through the IDisposable interface. My question is to what...
7
by: Tamir Khason | last post by:
I have a class public class Foo { public Foo() { DoSomething() } } I want to be able to do something else while the class enters GC - no more
0
by: Fernando Cacciola | last post by:
Hi People, Consider the following: class A : IDisposable { public A ( Stream aResource ) { mResource = aResource ; } public void Dispose() {
6
by: Bob | last post by:
When implementing the Dispose() method, I understand that it's supposed to do what Finalize() does so that's why it should call GC.SuppressFinalize(). However, it's not clear to me what happens the...
156
by: Dennis | last post by:
Ok, I'm trying to dispose of every object that I create that has a dispose method based on advice from this newsgroup. However, I'm not sure how to dispose of the following object that was created...
5
by: Michael Sander | last post by:
Hi, I found out, that a simple Form, created only with the designer, wont Dispose its contextmenu if you show the form, right-click it, and dispose the form afterwards. This isnt really what I...
5
by: Markus Stoeger | last post by:
Hi, I have a class similar to that: class MyClass : IDisposable { IDisposable obj1; IDisposable obj2; IDisposable obj3; MyClass() {
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.