Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / January 2007

Tip: Looking for answers? Try searching our database.

Forms deletes itself

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
RFOG - 30 Dec 2006 21:03 GMT
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.

Signature

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
========================================
Donde las dan las toman, y callar es bueno.

RFOG - 31 Dec 2006 11:12 GMT
> 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.

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.

Signature

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
========================================
Donde las dan las toman, y callar es bueno.

Ben Voigt - 01 Jan 2007 16:43 GMT
>> 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.

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.

> 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.
RFOG - 02 Jan 2007 10:03 GMT
Is any way to elude this?

> Because they are garbage collected objects, if they become unreachable,  
> they
[quoted text clipped - 13 lines]
>> ========================================
>> Donde las dan las toman, y callar es bueno.

Signature

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?
Nada, que me ha pegado una coz y se la he devuelto.

Ben Voigt - 03 Jan 2007 15:57 GMT
> Is any way to elude this?

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

>> Because they are garbage collected objects, if they become unreachable,
>> they
[quoted text clipped - 13 lines]
>>> ========================================
>>> Donde las dan las toman, y callar es bueno.
RFOG - 03 Jan 2007 18:22 GMT
Yes, thank you.

:-)

>> Is any way to elude this?
>
[quoted text clipped - 26 lines]
>> Oye Patxi, ¿que le pasa a la mula que viene llorando?
>> Nada, que me ha pegado una coz y se la he devuelto.

Signature

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.
        -- Andrés Segovia.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.