mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-24 21:21:05 +00:00
TONY: Fix some Valgrind identified memory leaks
This commit is contained in:
parent
734fae9193
commit
046620054f
@ -1829,6 +1829,18 @@ RMText::~RMText() {
|
||||
|
||||
}
|
||||
|
||||
void RMText::Unload() {
|
||||
if (m_fonts[0] != NULL) {
|
||||
delete m_fonts[0];
|
||||
delete m_fonts[1];
|
||||
delete m_fonts[2];
|
||||
delete m_fonts[3];
|
||||
m_fonts[0] = m_fonts[1] = m_fonts[2] = m_fonts[3] = 0;
|
||||
|
||||
g_system->unlockMutex(m_cs);
|
||||
}
|
||||
}
|
||||
|
||||
void RMText::SetMaxLineLength(int max) {
|
||||
maxLineLength = max;
|
||||
}
|
||||
|
@ -215,6 +215,7 @@ protected:
|
||||
public:
|
||||
RMText();
|
||||
virtual ~RMText();
|
||||
static void Unload();
|
||||
|
||||
// Setta il tipo di allineamento
|
||||
void SetAlignType(HORALIGN aHor, VERALIGN aVer) { aHorType=aHor; aVerType=aVer; }
|
||||
|
@ -1746,6 +1746,16 @@ RMDataStream &operator>>(RMDataStream &ds, RMBoxLoc &bl) {
|
||||
* RMGameBoxes methods
|
||||
\****************************************************************************/
|
||||
|
||||
RMGameBoxes::RMGameBoxes() {
|
||||
m_nLocBoxes = 0;
|
||||
Common::fill(m_allBoxes, m_allBoxes + GAME_BOXES_SIZE, (RMBoxLoc *)NULL);
|
||||
}
|
||||
|
||||
RMGameBoxes::~RMGameBoxes() {
|
||||
for (int i = 1; i <= m_nLocBoxes; ++i)
|
||||
delete m_allBoxes[i];
|
||||
}
|
||||
|
||||
void RMGameBoxes::Init(void) {
|
||||
int i;
|
||||
RMString fn;
|
||||
@ -1753,7 +1763,7 @@ void RMGameBoxes::Init(void) {
|
||||
|
||||
// Load boxes from disk
|
||||
m_nLocBoxes = 130;
|
||||
for (i=1; i <= m_nLocBoxes; i++) {
|
||||
for (i = 1; i <= m_nLocBoxes; i++) {
|
||||
RMRes res(10000 + i);
|
||||
|
||||
ds.OpenBuffer(res);
|
||||
|
@ -357,13 +357,17 @@ public:
|
||||
void RecalcAllAdj(void);
|
||||
};
|
||||
|
||||
#define GAME_BOXES_SIZE 200
|
||||
|
||||
class RMGameBoxes {
|
||||
protected:
|
||||
RMBoxLoc *m_allBoxes[200];
|
||||
RMBoxLoc *m_allBoxes[GAME_BOXES_SIZE];
|
||||
int m_nLocBoxes;
|
||||
|
||||
public:
|
||||
RMGameBoxes();
|
||||
~RMGameBoxes();
|
||||
|
||||
void Init(void);
|
||||
void Close(void);
|
||||
|
||||
|
@ -410,6 +410,7 @@ void TonyEngine::Close(void) {
|
||||
CloseMusic();
|
||||
CloseHandle(m_hEndOfFrame);
|
||||
_theBoxes.Close();
|
||||
RMText::Unload();
|
||||
_theEngine.Close();
|
||||
m_wnd.Close();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user