Author: bugman Date: Tue Feb 3 17:20:14 2015 New Revision: 27488 URL: http://svn.gna.org/viewcvs/relax?rev=27488&view=rev Log: Improved memory management for the Sequence and Sequence_2D input GUI elements.
These are mainly used in the user function GUI windows. The dialogs are now destroyed before a second is opened. Modified: trunk/gui/input_elements/sequence.py trunk/gui/input_elements/sequence_2D.py Modified: trunk/gui/input_elements/sequence.py URL: http://svn.gna.org/viewcvs/relax/trunk/gui/input_elements/sequence.py?rev=27488&r1=27487&r2=27488&view=diff ============================================================================== --- trunk/gui/input_elements/sequence.py (original) +++ trunk/gui/input_elements/sequence.py Tue Feb 3 17:20:14 2015 @@ -1,6 +1,6 @@ ############################################################################### # # -# Copyright (C) 2012-2014 Edward d'Auvergne # +# Copyright (C) 2012-2015 Edward d'Auvergne # # # # This file is part of the program relax (http://www.nmr-relax.com). # # # @@ -367,6 +367,7 @@ self.selection_win_data() # Destroy the window. + self.sel_win.Destroy() del self.sel_win @@ -387,6 +388,11 @@ def selection_win_show(self): """Show the selection window.""" + + # Destroy any pre-existing sequence window. + if hasattr(self, 'sel_win'): + self.sel_win.Destroy() + del self.sel_win # Initialise the model selection window. self.sel_win = Sequence_window(parent=self.parent, name=self.name, seq_type=self.seq_type, value_type=self.value_type, titles=self.titles, dim=self.dim) Modified: trunk/gui/input_elements/sequence_2D.py URL: http://svn.gna.org/viewcvs/relax/trunk/gui/input_elements/sequence_2D.py?rev=27488&r1=27487&r2=27488&view=diff ============================================================================== --- trunk/gui/input_elements/sequence_2D.py (original) +++ trunk/gui/input_elements/sequence_2D.py Tue Feb 3 17:20:14 2015 @@ -1,6 +1,6 @@ ############################################################################### # # -# Copyright (C) 2012-2014 Edward d'Auvergne # +# Copyright (C) 2012-2015 Edward d'Auvergne # # # # This file is part of the program relax (http://www.nmr-relax.com). # # # @@ -115,11 +115,17 @@ self.selection_win_data() # Destroy the window. + self.sel_win.Destroy() del self.sel_win def selection_win_show(self): """Show the selection window.""" + + # Destroy any pre-existing sequence window. + if hasattr(self, 'sel_win'): + self.sel_win.Destroy() + del self.sel_win # Initialise the window. self.sel_win = Sequence_window_2D(name=self.name, seq_type=self.seq_type, value_type=self.value_type, titles=self.titles, dim=self.dim) _______________________________________________ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits