[sushi] mainwindow: always clear the renderer before quitting



commit 52a0a6d00523d1d9635047ee7c109666d8c8c20f
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Apr 27 17:40:47 2011 -0400

    mainwindow: always clear the renderer before quitting

 src/js/ui/mainWindow.js |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/js/ui/mainWindow.js b/src/js/ui/mainWindow.js
index 1e6a78b..40286c3 100644
--- a/src/js/ui/mainWindow.js
+++ b/src/js/ui/mainWindow.js
@@ -96,7 +96,7 @@ MainWindow.prototype = {
      ****************** main object event callbacks ***************************
      **************************************************************************/
     _onWindowDeleteEvent : function() {
-        this._application.quit();
+        this._clearAndQuit();
     },
 
     _onStageKeyPressEvent : function(actor, event) {
@@ -473,8 +473,8 @@ MainWindow.prototype = {
         this._quitButton.show();
 
         this._quitButton.connect("clicked",
-                                 Lang.bind(this._application,
-                                           this._application.quit));
+                                 Lang.bind(this,
+                                           this._clearAndQuit));
 
         this._quitActor = new GtkClutter.Actor({ contents: this._quitButton });
         this._quitActor.set_reactive(true);
@@ -534,12 +534,19 @@ MainWindow.prototype = {
                            time: 0.15,
                            transition: 'easeOutQuad',
                            onComplete: function () {
-                               this._application.quit();
+                               this._clearAndQuit();
                            },
                            onCompleteScope: this
                          });
     },
 
+    _clearAndQuit : function() {
+        if (this._renderer.clear)
+            this._renderer.clear();
+
+        this._application.quit();
+    },
+
     /**************************************************************************
      ************************ public methods **********************************
      **************************************************************************/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]