gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-


From: Benjamin Wolsey
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-258-g1fa9d68
Date: Tue, 12 Apr 2011 14:44:50 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  1fa9d68365aa4877778939ce31e89187fa150125 (commit)
      from  361639dcdd2798487c7303c5d4dfe517fed5b8e6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=1fa9d68365aa4877778939ce31e89187fa150125


commit 1fa9d68365aa4877778939ce31e89187fa150125
Author: Benjamin Wolsey <address@hidden>
Date:   Tue Apr 12 16:05:30 2011 +0200

    Do not continue to advance during yesno().
    
    Both gtk and qt4 continue to execute the advance timer while the
    dialogue is showing; this results in a new advance() in the middle of
    action execution, which besides other unpredictable side-effects, can
    cause the empty call stack assertion to fail while marking reachable
    resources in the VM.

diff --git a/gui/gtk/gtk.cpp b/gui/gtk/gtk.cpp
index 4c5bd6e..b01526d 100644
--- a/gui/gtk/gtk.cpp
+++ b/gui/gtk/gtk.cpp
@@ -2192,6 +2192,7 @@ GtkGui::checkX11Extension(const std::string& ext)
 bool
 GtkGui::yesno(const std::string& question)
 {
+    stopAdvanceTimer();
     bool ret = true;
 
     GtkWidget *dialog = gtk_message_dialog_new(
@@ -2215,6 +2216,8 @@ GtkGui::yesno(const std::string& question)
 
     gtk_widget_destroy(dialog);
 
+    startAdvanceTimer();
+
     return ret;
 }
 
diff --git a/gui/qt/Qt4Gui.cpp b/gui/qt/Qt4Gui.cpp
index 70c1d96..43f34f9 100644
--- a/gui/qt/Qt4Gui.cpp
+++ b/gui/qt/Qt4Gui.cpp
@@ -79,7 +79,10 @@ namespace gnash
 {
 
 Qt4Gui::Qt4Gui(unsigned long xid, float scale, bool loop, RunResources& r)
- : Gui(xid, scale, loop, r)
+    :
+    Gui(xid, scale, loop, r),
+    _interval(0),
+    _advanceTimer(0)
 {
 }
 
@@ -99,7 +102,6 @@ Qt4Gui::setClipboard(const std::string& copy)
 bool
 Qt4Gui::init(int /*argc*/, char ** /*argv*/[])
 {
-
     char** r = NULL;
     int* i = new int(0);
 
@@ -296,7 +298,8 @@ Qt4Gui::setTimeout(unsigned int timeout)
 void
 Qt4Gui::setInterval(unsigned int interval)
 {
-    _drawingWidget->startTimer(interval);
+    _interval = interval;
+    _advanceTimer = _drawingWidget->startTimer(_interval);
 }
 
 void
@@ -556,11 +559,17 @@ Qt4Gui::showPreferences()
 bool
 Qt4Gui::yesno(const std::string& question)
 {
+    _drawingWidget->killTimer(_advanceTimer);
+
     QMessageBox* dialog = new QMessageBox(_drawingWidget);
     dialog->setText(QString::fromStdString(question));
     dialog->setStandardButtons(QMessageBox::Yes | QMessageBox::No);
     dialog->setDefaultButton(QMessageBox::Yes);
     const int ret = dialog->exec();
+
+    _advanceTimer = _drawingWidget->startTimer(_interval);
+
+
     if (ret == QMessageBox::Yes) return true;
     return false;
 }
diff --git a/gui/qt/Qt4Gui.h b/gui/qt/Qt4Gui.h
index 33e104d..deba84f 100644
--- a/gui/qt/Qt4Gui.h
+++ b/gui/qt/Qt4Gui.h
@@ -164,6 +164,10 @@ private:
     gnash::key::code qtToGnashKey(QKeyEvent *event);
     int qtToGnashModifier(const Qt::KeyboardModifiers modifiers);
 
+    int _interval;
+
+    int _advanceTimer;
+
     /// QActions and QMenus should be attached to the
     /// QMainWindow so that they are destroyed with it.
     /// Actions may be shared between menus and/or
diff --git a/libcore/vm/ActionExec.cpp b/libcore/vm/ActionExec.cpp
index 45b9d81..67630fb 100644
--- a/libcore/vm/ActionExec.cpp
+++ b/libcore/vm/ActionExec.cpp
@@ -306,11 +306,12 @@ ActionExec::operator()()
                             "executing code in %1% between pc %2% and %3%")) %
                             code.getMovieDefinition().get_url() % next_pc %
                             pc % (maxTime/1000);
-                    if ( getRoot(env).abortOnScriptTimeout(fmt.str()) ) {
+
+                    if (getRoot(env).abortOnScriptTimeout(fmt.str())) {
                         throw ActionLimitException(fmt.str());
-                    } else {
-                        clock.restart();
-                    }
+                    } 
+
+                    clock.restart();
                 }
                 // TODO: Run garbage collector ? If stack isn't too big ?
             }

-----------------------------------------------------------------------

Summary of changes:
 gui/gtk/gtk.cpp           |    3 +++
 gui/qt/Qt4Gui.cpp         |   15 ++++++++++++---
 gui/qt/Qt4Gui.h           |    4 ++++
 libcore/vm/ActionExec.cpp |    9 +++++----
 4 files changed, 24 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]