These are chat archives for ButchersBoy/Dragablz

7th
Jul 2016
Magnus Lindhe
@mgnslndh
Jul 07 2016 11:50
@ButchersBoy you there?
I think I might have found a memory issue with the TabablzControl
James Willock
@ButchersBoy
Jul 07 2016 11:51
Yeah, I'm here, but on phone
Magnus Lindhe
@mgnslndh
Jul 07 2016 11:51
Stay on the phone! :)
I'll write up what I've found and you can check it later
Magnus Lindhe
@mgnslndh
Jul 07 2016 12:00
The TabablzControl listens to the Closing event on the parent Window. https://github.com/ButchersBoy/Dragablz/blob/master/Dragablz/TabablzControl.cs#L831
It removes this event handler properly when the window is closing. https://github.com/ButchersBoy/Dragablz/blob/master/Dragablz/TabablzControl.cs#L836
I am having some memory issues in my application that I am troubleshooting right now. I can see in Visual Studio memory snapshot tool that there is a reference between the tabablzcontrol and the main window after I have removed my view. So it seems my view is kept in memory because it has a ref chain to the main window which is still alive and kicking.
Magnus Lindhe
@mgnslndh
Jul 07 2016 12:05
blob
I'll make a patch and see if that works but I'd like your take on this so I am not misunderstanding the TabablzControl
It could be that the event handler will be cleaned up as soon as there are no references to the View and thats was causing my problem. Not sure though
Magnus Lindhe
@mgnslndh
Jul 07 2016 12:44
Ok, I can at least confirm that the ref goes away if I remove the event handler on the window by disposing the _windowSubscription on Unload
Submitted a tiny PR for this ButchersBoy/Dragablz#111