diff --git a/CHANGES.rst b/CHANGES.rst index 6936ab9a..b856ef39 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -28,6 +28,13 @@ This release provides the following fixes: * Fixed issue in wx.lib.agw.customtreectrl where label editor could remain stuck forever (#1235). +* Fix a sometimes crash when using a wx.Overlay by letting the wx.DCOverlay hold + a reference to the DC, to ensure that the DCOverlay is destroyed first. + (PR#1301) + + + + 4.0.6 "Applesauce" ------------------ diff --git a/etg/overlay.py b/etg/overlay.py index 28b9331f..f2f93728 100644 --- a/etg/overlay.py +++ b/etg/overlay.py @@ -39,6 +39,9 @@ def run(): c = module.find('wxDCOverlay') c.addPrivateCopyCtor() + for m in c.find('wxDCOverlay').all(): + m.find('dc').keepReference = True + #----------------------------------------------------------------- diff --git a/wx/lib/inspection.py b/wx/lib/inspection.py index 1f511212..f014ac87 100644 --- a/wx/lib/inspection.py +++ b/wx/lib/inspection.py @@ -874,7 +874,7 @@ class _InspectionHighlighter(object): pos = self.FindHighlightPos(tlw, win.ClientToScreen(pos)) rect.SetPosition(pos) if rect.width < 1: rect.width = 1 - if rect.width < 1: rect.width = 1 + if rect.height < 1: rect.height = 1 self.DoHighlight(tlw, rect, self.color1, penWidth)