icsharpcode / WpfDesigner

The WPF Designer from SharpDevelop
MIT License
949 stars 251 forks source link

memory leak #49

Open 499940913 opened 6 years ago

499940913 commented 6 years ago

I find something memory leak when i call UnloadDesigner inDesignSurface

jogibear9988 commented 6 years ago

more infos?

499940913 commented 6 years ago

In the SimpleSample demo,I drag TestControl into designsurface and then call UnloadDesigner but the destructors of TestControl never invoke

jogibear9988 commented 6 years ago

Puh..

At first it's correct behavior, because if you Undo, Instance is reused...

But, if you do

        desItem.Services.GetService<UndoService>().Clear();
        GC.Collect();

it's also not called, so there seems to be an error. But atm. I've no time to search for it. If you find samt, I will fix.