From: Renaud Barate Date: Mon, 31 Mar 2014 14:19:33 +0000 (+0200) Subject: Fix Python modules with SIP 4.15 (avoid garbage collection of widgets added to the... X-Git-Tag: V7_4_0a1~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7578d4a18f50b377dc6e0acf6f60f14fe240a47a;p=modules%2Fgui.git Fix Python modules with SIP 4.15 (avoid garbage collection of widgets added to the desktop) --- diff --git a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip index 40e4b4bd1..b02119186 100644 --- a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip +++ b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip @@ -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/ ;