[mupen64plus] 152/262: Fix OSD crash after pause-stop-start-pause of emulator

Sven Eckelmann ecsv-guest at moszumanska.debian.org
Thu Nov 26 05:59:29 UTC 2015


This is an automated email from the git hooks/post-receive script.

ecsv-guest pushed a commit to branch master
in repository mupen64plus.

commit f07e53d5ef1e349fa7663b02375a8b1f47ebbdb9
Author: Sven Eckelmann <sven.eckelmann at gmx.de>
Date:   Mon Oct 5 21:22:29 2009 +0200

    Fix OSD crash after pause-stop-start-pause of emulator
    
    The osd message handler for pause messages are managed outside the
    message queue of the osd and will only be updated during
    pauseContinueEmulation, but the message is bound to an OpenGL context
    and thus must be also be deleted when the emulator is stopped and the
    video plugin shuts down.
---
 debian/changelog                     |  2 +
 debian/patches/osd-pause-crash.patch | 71 ++++++++++++++++++++++++++++++++++++
 debian/patches/series                |  1 +
 3 files changed, 74 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 6117de8..0f2c01f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -16,6 +16,8 @@ mupen64plus (1.5+dfsg1-6) UNRELEASED; urgency=low
     - Add fix_r0_override.patch, Don't allow to override r0 register
     - Add resume_on_start.patch, Resume when pressing on start when in pause
       mode to prevent corruption
+    - Add osd-pause-crash.patch, Fix OSD crash after pause-stop-start-pause of
+      emulator
 
  -- Sven Eckelmann <sven.eckelmann at gmx.de>  Sat, 03 Oct 2009 00:36:41 +0200
 
diff --git a/debian/patches/osd-pause-crash.patch b/debian/patches/osd-pause-crash.patch
new file mode 100644
index 0000000..d581dd2
--- /dev/null
+++ b/debian/patches/osd-pause-crash.patch
@@ -0,0 +1,71 @@
+Description: Fix OSD crash after pause-stop-start-pause of emulator
+ The osd message handler for pause messages are managed outside the message
+ queue of the osd and will only be updated during pauseContinueEmulation, but
+ the message is bound to an OpenGL context and thus must be also be deleted
+ when the emulator is stopped and the video plugin shuts down.
+Bug: http://code.google.com/p/mupen64plus/issues/detail?id=283
+Author: Sven Eckelmann <sven.eckelmann at gmx.de>
+
+---
+diff --git a/main/main.c b/main/main.c
+index 3c88498b7ccd3892e92fb6354085cace7f8ce2f0..3cc7011c04b6d7c68361c9d86fb0365770cd769a 100644
+--- a/main/main.c
++++ b/main/main.c
+@@ -486,11 +486,17 @@ void startEmulation(void)
+     }
+ }
+ 
++static osd_message_t *pause_msg = NULL;
+ void stopEmulation(void)
+ {
+     if(g_EmulatorRunning)
+     {
+         main_message(0, 1, 0, OSD_BOTTOM_LEFT, tr("Stopping emulation.\n"));
++        if(pause_msg)
++        {
++            osd_delete_message(pause_msg);
++            pause_msg = NULL;
++        }
+         rompause = 0;
+         stop_it();
+ #ifdef DBG
+@@ -522,8 +528,6 @@ void stopEmulation(void)
+ 
+ int pauseContinueEmulation(void)
+ {
+-    static osd_message_t *msg = NULL;
+-
+     if (!g_EmulatorRunning)
+         return 1;
+ 
+@@ -534,10 +538,10 @@ int pauseContinueEmulation(void)
+         g_romcache.rcspause = 1;
+ #endif
+         main_message(0, 1, 0, OSD_BOTTOM_LEFT, tr("Emulation continued.\n"));
+-        if(msg)
++        if(pause_msg)
+         {
+-            osd_delete_message(msg);
+-            msg = NULL;
++            osd_delete_message(pause_msg);
++            pause_msg = NULL;
+         }
+     }
+     else
+@@ -546,12 +550,12 @@ int pauseContinueEmulation(void)
+         gui_set_state(GUI_STATE_PAUSED);
+         g_romcache.rcspause = 0;
+ #endif
+-        if(msg)
+-            osd_delete_message(msg);
++        if(pause_msg)
++            osd_delete_message(pause_msg);
+ 
+         main_message(0, 1, 0, OSD_BOTTOM_LEFT, tr("Paused\n"));
+-        msg = osd_new_message(OSD_MIDDLE_CENTER, tr("Paused\n"));
+-        osd_message_set_static(msg);
++        pause_msg = osd_new_message(OSD_MIDDLE_CENTER, tr("Paused\n"));
++        osd_message_set_static(pause_msg);
+     }
+ 
+     rompause = !rompause;
diff --git a/debian/patches/series b/debian/patches/series
index 667a49f..59e99aa 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -32,3 +32,4 @@ load_aidacrate.patch
 load_vistatus.patch
 fix_r0_override.patch
 resume_on_start.patch
+osd-pause-crash.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/mupen64plus.git



More information about the Pkg-games-commits mailing list