G
Guest
I have created a sample Windows Forms Application, on mouse right click i
create a new ContextMenuStrip and shows it. I close the ContextMenuStrip by
clicking outside it or by clicking an item. Even after a GC.Collect call, the
ContextMenuStrip is never disposed.
Analysing with a .NET Memory Profiler i have noticed that, after closure,
the ContextMenuStrip is still alive : referenced by the ControlNativeWindow
and by SytemEvents handlers.
I have tried to call a Dispose in ContextMenuStrip.Closed handler, but it
raises an exception. Any idea ?
create a new ContextMenuStrip and shows it. I close the ContextMenuStrip by
clicking outside it or by clicking an item. Even after a GC.Collect call, the
ContextMenuStrip is never disposed.
Analysing with a .NET Memory Profiler i have noticed that, after closure,
the ContextMenuStrip is still alive : referenced by the ControlNativeWindow
and by SytemEvents handlers.
I have tried to call a Dispose in ContextMenuStrip.Closed handler, but it
raises an exception. Any idea ?