Groups | Blog | Home
all groups > visual c > december 2006 >

visual c : Forms deletes itself


RFOG
12/30/2006 10:03:33 PM
Hello all!

I've a bunch of forms that I create on app startup. But sometimes they are
auto disposed. I don't understand why, because I instantiate them by gcnew
and does not delete until app ends.

--
Visita mi blog principal: http://rfog.blogsome.com
Y este sobre programación: http://geeks.ms/blogs/rfog
Libros, ciencia ficción y programación
========================================
RFOG
12/31/2006 12:12:40 PM
On Sat, 30 Dec 2006 22:03:33 +0100, RFOG
[quoted text, click to view]
I think I've resolved the issue.

It is related to a Windows Forms timer, if form is closed and timer fires
and closes the form, the form is distroyed.


--
Visita mi blog principal: http://rfog.blogsome.com
Y este sobre programación: http://geeks.ms/blogs/rfog
Libros, ciencia ficción y programación
========================================
Ben Voigt
1/1/2007 10:43:10 AM

[quoted text, click to view]

Because they are garbage collected objects, if they become unreachable, they
will be finalized and the memory reclaimed, even though you don't call
delete.

[quoted text, click to view]

RFOG
1/2/2007 11:03:09 AM
Is any way to elude this?

[quoted text, click to view]



--
Visita mi blog principal: http://rfog.blogsome.com
Y este sobre programación: http://geeks.ms/blogs/rfog
Libros, ciencia ficción y programación
========================================
Oye Patxi, ¿que le pasa a la mula que viene llorando?
Ben Voigt
1/3/2007 9:57:01 AM

[quoted text, click to view]

Make sure they stay reachable from a gc rooted object, like a static
variable in some class.

[quoted text, click to view]

RFOG
1/3/2007 7:22:49 PM
Yes, thank you.

:-)

[quoted text, click to view]



--
Visita mi blog principal: http://rfog.blogsome.com
Y este sobre programación: http://geeks.ms/blogs/rfog
Libros, ciencia ficción y programación
========================================
La tragedia de la edad no es ser viejo, sino que se sea joven y la gente
no lo vea.
AddThis Social Bookmark Button