Ticket #8846: memorypatches

File memorypatches, 3.8 KB (added by SF/gamblore, 16 years ago)

Patches for all files listed

Line 
1Index: gui/eval.cpp
2===================================================================
3--- gui/eval.cpp (revision 31189)
4+++ gui/eval.cpp (working copy)
5@@ -43,6 +43,7 @@
6 Eval::~Eval() {
7 _vars.clear();
8 _aliases.clear();
9+ _strings.clear();
10 }
11
12 int Eval::eval(const String &input, const String &section, const String &name, int startpos) {
13@@ -327,6 +328,7 @@
14 void Eval::reset() {
15 _vars.clear();
16 _aliases.clear();
17+ _strings.clear();
18 loadConstants();
19 }
20
21Index: common/singleton.h
22===================================================================
23--- common/singleton.h (revision 31189)
24+++ common/singleton.h (working copy)
25@@ -71,6 +71,11 @@
26 _singleton = T::makeInstance();
27 return *_singleton;
28 }
29+ virtual void destroy() {
30+ if (_singleton){
31+ delete _singleton;
32+ }
33+ }
34 protected:
35 Singleton<T>() { }
36 #ifdef __SYMBIAN32__
37Index: engines/scumm/scumm.cpp
38===================================================================
39--- engines/scumm/scumm.cpp (revision 31189)
40+++ engines/scumm/scumm.cpp (working copy)
41@@ -885,6 +885,10 @@
42 delete _splayer;
43 }
44
45+ if (_insane) {
46+ delete _insane;
47+ }
48+
49 free(_languageBuffer);
50 free(_languageIndex);
51 }
52@@ -1201,6 +1205,9 @@
53 _fmtownsBuf = (byte *)malloc(_screenWidth * _textSurfaceMultiplier * _screenHeight * _textSurfaceMultiplier);
54 }
55
56+ if (_compositeBuf) {
57+ free(_compositeBuf);
58+ }
59 _compositeBuf = (byte *)malloc(_screenWidth * _textSurfaceMultiplier * _screenHeight * _textSurfaceMultiplier);
60 }
61
62Index: sound/softsynth/adlib.cpp
63===================================================================
64--- sound/softsynth/adlib.cpp (revision 31189)
65+++ sound/softsynth/adlib.cpp (working copy)
66@@ -871,6 +871,7 @@
67 }
68
69 // Turn off the OPL emulation
70+ OPLDestroy(_opl);
71 // YM3812Shutdown();
72
73 free(_adlib_reg_cache);
74Index: graphics/scaler.cpp
75===================================================================
76--- graphics/scaler.cpp (revision 31189)
77+++ graphics/scaler.cpp (working copy)
78@@ -112,7 +112,12 @@
79 #endif
80 }
81
82+void DestroyScalers(){
83+ free(RGBtoYUV);
84+ free(LUT16to32);
85+}
86
87+
88 /**
89 * Trivial 'scaler' - in fact it doesn't do any scaling but just copies the
90 * source to the destionation.
91Index: graphics/scaler.h
92===================================================================
93--- graphics/scaler.h (revision 31189)
94+++ graphics/scaler.h (working copy)
95@@ -29,6 +29,7 @@
96 #include "graphics/surface.h"
97
98 extern void InitScalers(uint32 BitFormat);
99+extern void DestroyScalers();
100
101 typedef void ScalerProc(const uint8 *srcPtr, uint32 srcPitch,
102 uint8 *dstPtr, uint32 dstPitch, int width, int height);
103Index: backends/platform/sdl/graphics.cpp
104===================================================================
105--- backends/platform/sdl/graphics.cpp (revision 31189)
106+++ backends/platform/sdl/graphics.cpp (working copy)
107@@ -459,6 +459,7 @@
108 _osdSurface = NULL;
109 }
110 #endif
111+ DestroyScalers();
112 }
113
114 void OSystem_SDL::hotswapGFXMode() {
115Index: backends/platform/sdl/sdl.cpp
116===================================================================
117--- backends/platform/sdl/sdl.cpp (revision 31189)
118+++ backends/platform/sdl/sdl.cpp (working copy)
119@@ -309,9 +309,23 @@
120 if (_joystick)
121 SDL_JoystickClose(_joystick);
122 SDL_ShowCursor(SDL_ENABLE);
123+
124+ SDL_RemoveTimer(_timerID);
125+ SDL_CloseAudio();
126+
127+ free(_dirtyChecksums);
128+ free(_currentPalette);
129+ free(_cursorPalette);
130+ free(_mouseData);
131+
132+ delete _savefile;
133+ delete _mixer;
134+ delete _timer;
135+
136 SDL_Quit();
137
138 delete getEventManager();
139+
140 exit(0);
141 }
142
143Index: base/main.cpp
144===================================================================
145--- base/main.cpp (revision 31189)
146+++ base/main.cpp (working copy)
147@@ -329,6 +329,10 @@
148
149 launcherDialog(system);
150 }
151+ PluginManager::instance().unloadPluginsExcept(NULL);
152+ PluginManager::instance().destroy();
153+ ConfMan.~ConfigManager();
154+ delete g_gui.theme();
155
156 return 0;
157 }
158