|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
windows forms leakHello,
I've created a windows application with custom message loop, without using an Application.Run method, and got all my forms not garbage-collected. Profiler shows that forms' instances are referenced only by their own event handlers. Clearing them manually helps, but this solution is not applicable for all forms which can possibly be created inside the process. Can this somehow be worked around? Thanks, -- Best regards, Vyacheslav Lukianov Software Developer JetBrains, Inc. http://www.jetbrains.com "Develop with pleasure!" I think this is because
System.Windows.Forms.Application.AddMessageFilter(...) holds a reference to your form. You should put somewhere RemoveMessageFilter Show quoteHide quote "Vyacheslav Lukianov" <l**@intellij.net> wrote in message news:5661812e28c71b8c6e7381adfdfb4@news.microsoft.com... > Hello, > > I've created a windows application with custom message loop, without using > an Application.Run method, and got all my forms not garbage-collected. > Profiler shows that forms' instances are referenced only by their own > event handlers. Clearing them manually helps, but this solution is not > applicable for all forms which can possibly be created inside the process. > Can this somehow be worked around? > > Thanks, > > -- > Best regards, > Vyacheslav Lukianov > Software Developer > JetBrains, Inc. > http://www.jetbrains.com > "Develop with pleasure!" > > > Hello Giedrius,
G> I think this is because G> System.Windows.Forms.Application.AddMessageFilter(...) holds a G> reference to your form. You should put somewhere RemoveMessageFilter Thanks for the reply! But the problem appeared not related to custom message loop. Actually, we've discovered one more bug in Windows Forms. Briefly, ListView.Dispose() doesn't unhook all event handlers from imagelists, which are attached to the listview. So these imagelists do keep references to forms containing such listsviews. Here is detailed description: http://blogs.jetbrains.com/yole/archives/000037.html. -- Best regards, Vyacheslav Lukianov Software Developer JetBrains, Inc. http://www.jetbrains.com "Develop with pleasure!"
Maximum number of threads in a process
run app remotely? Get environment from remote machine Forcing traffic to a proxy server Socket Send and Receive Thread Safety Assume SQL Server Rights for apps, any cons? Load framework first time Assign attributes to a property at runtime ? Unix and .NET ServiceBase.OnStop doesn't work properly |
|||||||||||||||||||||||