Merge pull request #1301 from wxWidgets/fix-overlay-crash

Fix overlay crash

(cherry picked from commit de4d1d811a)
This commit is contained in:
Robin Dunn
2019-07-08 21:34:15 -07:00
committed by Robin Dunn
parent 6d77ad6341
commit fbc2e9875e
3 changed files with 11 additions and 1 deletions

View File

@@ -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"
------------------

View File

@@ -39,6 +39,9 @@ def run():
c = module.find('wxDCOverlay')
c.addPrivateCopyCtor()
for m in c.find('wxDCOverlay').all():
m.find('dc').keepReference = True
#-----------------------------------------------------------------

View File

@@ -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)