Update of /cvsroot/audacity/audacity-src/src
In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv26614/src

Modified Files:
        AudioIO.cpp AudioIO.h Project.cpp 
Log Message:
David Henningsson's patch to prevent crashes when closing the project that is
the AudioIO listener; also prevent newly-opened projects from stealing listener
status from recording ones.


Index: Project.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Project.cpp,v
retrieving revision 1.474
retrieving revision 1.475
diff -u -d -r1.474 -r1.475
--- Project.cpp 21 Nov 2009 21:21:22 -0000      1.474
+++ Project.cpp 24 Nov 2009 21:56:34 -0000      1.475
@@ -1987,6 +1987,12 @@
          gActiveProject = NULL;
       }
    }
+
+   // Since we're going to be destroyed, make sure we're not to 
+   // receive audio notifications anymore.
+   if (gAudioIO->GetListener() == this) {
+      gAudioIO->SetListener(gActiveProject);
+   }
    
    if (gAudacityProjects.IsEmpty() && !gIsQuitting) {
 

Index: AudioIO.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/AudioIO.cpp,v
retrieving revision 1.238
retrieving revision 1.239
diff -u -d -r1.238 -r1.239
--- AudioIO.cpp 24 Nov 2009 03:16:37 -0000      1.238
+++ AudioIO.cpp 24 Nov 2009 21:56:34 -0000      1.239
@@ -2283,6 +2283,9 @@
 
 void AudioIO::SetListener(AudioIOListener* listener)
 {
+   if (IsBusy())
+      return;
+
    mListener = listener;
 }
 

Index: AudioIO.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/AudioIO.h,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -d -r1.82 -r1.83
--- AudioIO.h   21 Nov 2009 22:16:36 -0000      1.82
+++ AudioIO.h   24 Nov 2009 21:56:34 -0000      1.83
@@ -80,6 +80,7 @@
    AudioIO();
    ~AudioIO();
 
+   AudioIOListener* GetListener() { return mListener; }
    void SetListener(AudioIOListener* listener);
    
    /** \brief Start up Portaudio for capture and recording as needed for


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Audacity-cvs mailing list
Audacity-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to