[Scummvm-cvs-logs] SF.net SVN: scummvm:[54311] scummvm/trunk/gui
    Bluddy at users.sourceforge.net 
    Bluddy at users.sourceforge.net
       
    Thu Nov 18 08:17:53 CET 2010
    
    
  
Revision: 54311
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54311&view=rev
Author:   Bluddy
Date:     2010-11-18 07:17:53 +0000 (Thu, 18 Nov 2010)
Log Message:
-----------
GUI: changed tooltip to be deleted when inactive
Before, it could be instantiated after an engine loaded and then was never deleted, causing memory fragmentation. Also removed inner tooltip call to the GuiManager runloop, which makes the logic simpler since the tooltip is a bit of a hack. I had to remove it because deleting _tooltip in the inner loop (called from tooltip itself) is trouble.
Modified Paths:
--------------
    scummvm/trunk/gui/Tooltip.cpp
    scummvm/trunk/gui/gui-manager.cpp
Modified: scummvm/trunk/gui/Tooltip.cpp
===================================================================
--- scummvm/trunk/gui/Tooltip.cpp	2010-11-18 07:17:28 UTC (rev 54310)
+++ scummvm/trunk/gui/Tooltip.cpp	2010-11-18 07:17:53 UTC (rev 54311)
@@ -72,7 +72,6 @@
 	_y = MIN<int16>(g_gui.getTopDialog()->_y + y + _ydelta, g_gui.getHeight() - _h - 3);
 
 	open();
-	g_gui.runLoop();
 
 	return true;
 }
Modified: scummvm/trunk/gui/gui-manager.cpp
===================================================================
--- scummvm/trunk/gui/gui-manager.cpp	2010-11-18 07:17:28 UTC (rev 54310)
+++ scummvm/trunk/gui/gui-manager.cpp	2010-11-18 07:17:53 UTC (rev 54311)
@@ -381,10 +381,14 @@
 
 			_tooltipCheck = false;
 			_tooltip->tooltipModal(_lastMousePosition.x, _lastMousePosition.y);
+			activeDialog = getTopDialog();
 		}
 
 		if (eventTookplace && _tooltip) {
 			_tooltip->mustClose();
+			delete _tooltip;
+			_tooltip = 0;
+			activeDialog = getTopDialog();
 		}
 
 		// Delay for a moment
@@ -399,7 +403,7 @@
 		_theme->disable();
 		restoreState();
 		_useStdCursor = false;
-	}
+	}	
 }
 
 #pragma mark -
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
    
    
More information about the Scummvm-git-logs
mailing list