[Scummvm-cvs-logs] SF.net SVN: scummvm:[45196] scummvm/trunk/engines/sci

wjpalenstijn at users.sourceforge.net wjpalenstijn at users.sourceforge.net
Sat Oct 17 19:59:09 CEST 2009


Revision: 45196
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45196&view=rev
Author:   wjpalenstijn
Date:     2009-10-17 17:59:09 +0000 (Sat, 17 Oct 2009)

Log Message:
-----------
SCI: Fix delete/free mismatches

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/savegame.cpp
    scummvm/trunk/engines/sci/gui/gui_cursor.cpp
    scummvm/trunk/engines/sci/sfx/songlib.cpp

Modified: scummvm/trunk/engines/sci/engine/savegame.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/savegame.cpp	2009-10-17 17:46:48 UTC (rev 45195)
+++ scummvm/trunk/engines/sci/engine/savegame.cpp	2009-10-17 17:59:09 UTC (rev 45196)
@@ -483,7 +483,7 @@
 	if (s.isLoading()) {
 		obj._lib = 0;
 		while (songcount--) {
-			Song *newsong = (Song *)calloc(1, sizeof(Song));
+			Song *newsong = new Song;
 			sync_song_t(s, *newsong);
 			obj.addSong(newsong);
 		}

Modified: scummvm/trunk/engines/sci/gui/gui_cursor.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_cursor.cpp	2009-10-17 17:46:48 UTC (rev 45195)
+++ scummvm/trunk/engines/sci/gui/gui_cursor.cpp	2009-10-17 17:59:09 UTC (rev 45196)
@@ -109,7 +109,7 @@
 	CursorMan.replaceCursor(rawBitmap, SCI_CURSOR_SCI0_HEIGHTWIDTH, SCI_CURSOR_SCI0_HEIGHTWIDTH, hotspot.x, hotspot.y, SCI_CURSOR_SCI0_TRANSPARENCYCOLOR);
 	CursorMan.showMouse(true);
 
-	delete rawBitmap;
+	delete[] rawBitmap;
 }
 
 void SciGuiCursor::setView(GuiResourceId viewNum, int loopNum, int celNum, Common::Point *hotspot) {

Modified: scummvm/trunk/engines/sci/sfx/songlib.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/songlib.cpp	2009-10-17 17:46:48 UTC (rev 45195)
+++ scummvm/trunk/engines/sci/sfx/songlib.cpp	2009-10-17 17:59:09 UTC (rev 45196)
@@ -32,6 +32,7 @@
 
 Song::Song() {
 	_handle = 0;
+	_resourceNum = 0;
 	_priority = 0;
 	_status = SOUND_STATUS_STOPPED;
 
@@ -51,6 +52,7 @@
 
 Song::Song(SongHandle handle, SongIterator *it, int priority) {
 	_handle = handle;
+	_resourceNum = 0;
 	_priority = priority;
 	_status = SOUND_STATUS_STOPPED;
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list