diff -Nru fife-0.4.0/debian/changelog fife-0.4.0/debian/changelog
--- fife-0.4.0/debian/changelog 2017-01-22 01:16:48.000000000 +0100
+++ fife-0.4.0/debian/changelog 2017-08-21 07:59:18.000000000 +0200
@@ -1,3 +1,12 @@
+fife (0.4.0-3+deb9u1) stretch; urgency=medium
+
+  * Team upload.
+  * Add 1000-icon-mem-leak.patch and fix a memory leak.
+    Thanks to Petter Reinholdtsen for the report and testing and LinuxDonald
+    for the patch. (Closes: #871782)
+
+ -- Markus Koschany <a...@debian.org>  Mon, 21 Aug 2017 07:59:18 +0200
+
 fife (0.4.0-3) unstable; urgency=medium
 
   * Team upload.
diff -Nru fife-0.4.0/debian/patches/1000-icon-mem-leak.patch 
fife-0.4.0/debian/patches/1000-icon-mem-leak.patch
--- fife-0.4.0/debian/patches/1000-icon-mem-leak.patch  1970-01-01 
01:00:00.000000000 +0100
+++ fife-0.4.0/debian/patches/1000-icon-mem-leak.patch  2017-08-21 
07:58:20.000000000 +0200
@@ -0,0 +1,42 @@
+Description: pychan: Remove Icon from manager on source load failure
+    
+    When creating an `Icon` with an invalid file path, the `Icon` object
+    first calls its parent's `__init__()` and then trys to load the image
+    source.  Loading the image might end up in e.g. `fife.NotFound`, but the
+    parent's `__init__()` already added the new `Icon` instance to the
+    manager. So while the code creating the `Icon` will never see an
+    instance of it and can never call `hide()` to remove it, the manager
+    still thinks that there's an instance available.
+    
+    This commit changes to code to remove the `Icon` from the manager for
+    any occuring exception and then re-raise the exception.
+    
+Origin: 
https://github.com/fifengine/fifengine/commit/2efebb3a0940e2570d2e7abeb54957dcb6f110ea
+Author: MasterofJOKers <jo...@someserver.de>
+Bug-Debian: https://bugs.debian.org/871782
+
+diff --git a/engine/python/fife/extensions/pychan/widgets/icon.py 
b/engine/python/fife/extensions/pychan/widgets/icon.py
+index 9d5daf3b..b94a6a58 100644
+--- a/engine/python/fife/extensions/pychan/widgets/icon.py
++++ b/engine/python/fife/extensions/pychan/widgets/icon.py
+@@ -26,6 +26,7 @@ from fife import fifechan
+ from fife.extensions.pychan.attrs import Attr, BoolAttr
+ from fife.extensions.pychan.properties import ImageProperty
+ 
++from common import get_manager
+ from widget import Widget
+ 
+ 
+@@ -88,7 +89,11 @@ class Icon(Widget):
+ 
+               if scale is not None: self.scale = scale
+ 
+-              self.image = image
++              try:
++                      self.image = image
++              except Exception:
++                      get_manager().removeWidget(self)
++                      raise
+               
+               #if the size parameter is specified set it (again) to override
+               #the icons size.
diff -Nru fife-0.4.0/debian/patches/series fife-0.4.0/debian/patches/series
--- fife-0.4.0/debian/patches/series    1970-01-01 01:00:00.000000000 +0100
+++ fife-0.4.0/debian/patches/series    2017-08-21 07:58:20.000000000 +0200
@@ -0,0 +1 @@
+1000-icon-mem-leak.patch

Attachment: signature.asc
Description: OpenPGP digital signature



Reply via email to