]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Fix Python modules with SIP 4.15 (avoid garbage collection of widgets added to the...
authorRenaud Barate <renaud.barate@edf.fr>
Mon, 31 Mar 2014 14:19:33 +0000 (16:19 +0200)
committerRenaud Barate <renaud.barate@edf.fr>
Tue, 1 Apr 2014 16:23:15 +0000 (18:23 +0200)
src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip

index 40e4b4bd18497a2602b362a954c66ca708ada31c..b021191868a54a077fbc2c559bd85c04c0423b59 100644 (file)
@@ -291,7 +291,20 @@ class SalomePyQt
 %End
 
 public:
+/* KeepReference is necessary on method getDesktop with SIP >= 4.15.5 to avoid garbage collection of
+   the Python objects added to the desktop. This causes a small memory leak (the wrapper around desktop
+   object is never garbage collected) but since this object contains only references this is not
+   considered a big problem. With versions < 4.15, it seems that this reference was kept implicitly.
+   No proper solution was found for versions between 4.15 and 4.15.4 (included), so those versions
+   should not be used to compile GUI module.
+*/
+%If (SIP_4_15_5 - )
+  static QWidget*          getDesktop() /ReleaseGIL,KeepReference/ ;
+%End
+%If ( - SIP_4_15_5)
   static QWidget*          getDesktop() /ReleaseGIL/ ;
+%End
+
   static QWidget*          getMainFrame() /ReleaseGIL/ ;
   static QMenuBar*         getMainMenuBar() /ReleaseGIL/ ;
   static QMenu*            getPopupMenu( const MenuName ) /ReleaseGIL/ ;