gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog backend/sound_handler_sdl.cpp b...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog backend/sound_handler_sdl.cpp b...
Date: Tue, 03 Jul 2007 04:31:59 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/07/03 04:31:59

Modified files:
        .              : ChangeLog 
        backend        : sound_handler_sdl.cpp sound_handler_sdl.h 

Log message:
                * backend/sound_handler_sdl.{cpp,h}: fix leak of sound_data 
instances;
                  added a few TODO items.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3644&r2=1.3645
http://cvs.savannah.gnu.org/viewcvs/gnash/backend/sound_handler_sdl.cpp?cvsroot=gnash&r1=1.72&r2=1.73
http://cvs.savannah.gnu.org/viewcvs/gnash/backend/sound_handler_sdl.h?cvsroot=gnash&r1=1.27&r2=1.28

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3644
retrieving revision 1.3645
diff -u -b -r1.3644 -r1.3645
--- ChangeLog   3 Jul 2007 01:12:44 -0000       1.3644
+++ ChangeLog   3 Jul 2007 04:31:58 -0000       1.3645
@@ -1,5 +1,10 @@
 2007-07-02 Sandro Santilli <address@hidden>
 
+       * backend/sound_handler_sdl.{cpp,h}: fix leak of sound_data instances;
+         added a few TODO items.
+
+2007-07-02 Sandro Santilli <address@hidden>
+
        * server/parser/edit_text_character_def.h: add an htmlAllowed()
          public inspector.
        * server/edit_text_character.h: add an htmlAllowed() private

Index: backend/sound_handler_sdl.cpp
===================================================================
RCS file: /sources/gnash/gnash/backend/sound_handler_sdl.cpp,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -b -r1.72 -r1.73
--- backend/sound_handler_sdl.cpp       2 Jul 2007 13:53:19 -0000       1.72
+++ backend/sound_handler_sdl.cpp       3 Jul 2007 04:31:59 -0000       1.73
@@ -18,7 +18,7 @@
 // Based on sound_handler_sdl.cpp by Thatcher Ulrich http://tulrich.com 2003
 // which has been donated to the Public Domain.
 
-// $Id: sound_handler_sdl.cpp,v 1.72 2007/07/02 13:53:19 tgc Exp $
+// $Id: sound_handler_sdl.cpp,v 1.73 2007/07/03 04:31:59 strk Exp $
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -375,14 +375,15 @@
 }
 
 
-void   SDL_sound_handler::delete_sound(int sound_handle)
 // this gets called when it's done with a sample.
+void   SDL_sound_handler::delete_sound(int sound_handle)
 {
        mutex::scoped_lock lock(_mutex);
 
        if (sound_handle >= 0 && static_cast<unsigned int>(sound_handle) < 
m_sound_data.size())
        {
-               delete[] m_sound_data[sound_handle]->data;
+               delete m_sound_data[sound_handle];
+               m_sound_data[sound_handle] = NULL;
        }
 
 }

Index: backend/sound_handler_sdl.h
===================================================================
RCS file: /sources/gnash/gnash/backend/sound_handler_sdl.h,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- backend/sound_handler_sdl.h 1 Jul 2007 10:53:49 -0000       1.27
+++ backend/sound_handler_sdl.h 3 Jul 2007 04:31:59 -0000       1.28
@@ -14,7 +14,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-// $Id: sound_handler_sdl.h,v 1.27 2007/07/01 10:53:49 bjacques Exp $
+// $Id: sound_handler_sdl.h,v 1.28 2007/07/03 04:31:59 strk Exp $
 
 #ifndef SOUND_HANDLER_SDL_H
 #define SOUND_HANDLER_SDL_H
@@ -115,6 +115,8 @@
 {
 public:
        /// The undecoded data
+       //
+       /// TODO: use boost::scoped_array
        uint8_t* data;
 
        /// Format of the sound (MP3, raw, etc).
@@ -137,8 +139,17 @@
        int volume;
 
        /// Vector containing the active instances of this sounds being played
+       //
+       /// TODO: define ownership of the active_sound elements
+       ///
        std::vector<active_sound*>      m_active_sounds;
 
+       ~sound_data()
+       {
+               // TODO: use boost::scoped_array
+               delete [] data;
+       }
+
 };
 
 




reply via email to

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