Fix GDI Leak in CheckListCtrlMixin

The mixin creates and sets a wx.Imagelist which doesn't get destroyed and thus is leaking 4 GDI Objects on every run. Changing SetImageList to AssignImageList fixes this. An alternative solution would be binding the wx.EVT_WINDOW_DESTROY Event and calling the Destroy-method manually.
This commit is contained in:
Konstantin Bolshakov
2018-02-16 10:52:55 +01:00
committed by GitHub
parent 929269e606
commit 42969c1aec

View File

@@ -732,7 +732,7 @@ class CheckListCtrlMixin(object):
self.uncheck_image = self.__imagelist_.Add(uncheck_image)
self.check_image = self.__imagelist_.Add(check_image)
self.SetImageList(self.__imagelist_, wx.IMAGE_LIST_SMALL)
self.AssignImageList(self.__imagelist_, wx.IMAGE_LIST_SMALL)
self.__last_check_ = None
self.Bind(wx.EVT_LEFT_DOWN, self.__OnLeftDown_)