]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix so async wxSound can continue playing after it is destructed,
authorRobin Dunn <robin@alldunn.com>
Thu, 22 Jul 2004 04:22:47 +0000 (04:22 +0000)
committerRobin Dunn <robin@alldunn.com>
Thu, 22 Jul 2004 04:22:47 +0000 (04:22 +0000)
courtesy of Ryan Norton.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28382 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/sound.cpp

index 17e46752a830d6bde04716da04a55e77c5582ade..5d8f7ddacc1d8d73908bef188982de7613cfbf0d 100644 (file)
@@ -88,6 +88,14 @@ public:
         DisposeMovie(m_movie);
         m_movie = NULL ;
         Stop();
+
+        //Note that ExitMovies() is not neccessary, but
+        //the docs are fuzzy on whether or not TerminateQTML is
+        ExitMovies();
+
+     #ifndef __WXMAC__
+        TerminateQTML();
+     #endif
     }
 
     void Notify()
@@ -173,7 +181,7 @@ Boolean wxIsQuickTime4Installed (void)
     long result;
 
     error = Gestalt (gestaltQuickTime, &result);
-    return (error == noErr) && (result >= 4);  //result >= 4 correct?
+    return (error == noErr) && (((result >> 16) & 0xffff) >= 0x0400);
 #else
     return true;
 #endif
@@ -219,7 +227,6 @@ wxSound::wxSound(int size, const wxByte* data)
 
 wxSound::~wxSound()
 {
-    FreeData();
 }
 
 bool wxSound::Create(const wxString& fileName, bool isResource)
@@ -302,6 +309,8 @@ bool wxSound::DoPlay(unsigned flags) const
 
             SetMovieVolume(movie, kFullVolume);
             GoToBeginningOfMovie(movie);
+
+            DisposeHandle(myHandle);
         }
         break;
     case wxSound_RESOURCE:
@@ -420,13 +429,9 @@ bool wxSound::FreeData()
         m_pTimer = NULL;
     }
 
-    //Note that ExitMovies() is not neccessary, but
-    //the docs are fuzzy on whether or not TerminateQTML is
-    ExitMovies();
-
-#ifndef __WXMAC__
-    TerminateQTML();
-#endif
     return true;
 }
 #endif //wxUSE_SOUND
+
+
+