PopupHelper hold reference to my userControls popups!

Topics: Issues / bugs
Feb 5, 2013 at 3:33 PM
Edited Feb 5, 2013 at 3:35 PM
your pleasewaitservice has a class popupHelper, and this seems to hold a reference to my/Devexpress popups, so GC can't collect the whole usercontrol. How to fix it?
Feb 9, 2013 at 1:38 PM
I assume you are using Silverlight? Can you provide a repro so I can easily debug the issue?
Feb 9, 2013 at 1:42 PM
I checked the source code quickly. We store a WeakReference to the parentElement or RootVisual if parentElement is not specified. This should not be causing the leak. The container popup is not linked to any control, so I cannot test this without a proper repro.

Did you override the CreateBusyIndicator method in your own version of the PleaseWaitService?
Feb 9, 2013 at 6:27 PM
No, I use wpf!

I can definetly say it is the popupHelper class, I tested it with the .net memory profiler! There is a list holding a reference, Gc can't collect my usercontrol, which I think is the visual root of my popup. I deactivated the pleasewaitservice, and now gc can collect my usercontrol!
Ok I will try to provide a repro.
Feb 12, 2013 at 3:24 PM
Unfortunately I have no time to reproduce the problem, maybe later I will have enough time to build a more complex project.

But at the moment I fixed the problem by calling PopupHelper.GetAllPopups() which calls the private method FindAllPopups() in which the List<Popup> _popups is cleared. After that GC can collect my userControl. Without that, the usercontrol is alive the whole app lifetime.
Feb 13, 2013 at 12:55 PM
Ok, there is no reason why the popups should be held in a field. I have removed that and the issue should be solved.