mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-17 00:07:41 +02:00
Fixes to some crashes on exit and to have cleaner valgrind output
This commit is contained in:
@ -908,17 +908,26 @@ void playIntro()
|
|||||||
|
|
||||||
void dispose()
|
void dispose()
|
||||||
{
|
{
|
||||||
if (console)
|
if(VLC)
|
||||||
delete console;
|
{
|
||||||
|
delete VLC;
|
||||||
|
VLC = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
// cleanup, mostly to remove false leaks from analyzer
|
// cleanup, mostly to remove false leaks from analyzer
|
||||||
CResourceHandler::clear();
|
CResourceHandler::clear();
|
||||||
if (CCS)
|
if(CCS)
|
||||||
{
|
{
|
||||||
CCS->musich->release();
|
CCS->musich->release();
|
||||||
CCS->soundh->release();
|
CCS->soundh->release();
|
||||||
}
|
}
|
||||||
CMessage::dispose();
|
CMessage::dispose();
|
||||||
|
|
||||||
|
if(console)
|
||||||
|
{
|
||||||
|
delete console; // should be removed after everything else since used by logging
|
||||||
|
console = nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool checkVideoMode(int monitorIndex, int w, int h, int& bpp, bool fullscreen)
|
static bool checkVideoMode(int monitorIndex, int w, int h, int& bpp, bool fullscreen)
|
||||||
|
@ -635,7 +635,8 @@ int main(int argc, char** argv)
|
|||||||
//and return non-zero status so client can detect error
|
//and return non-zero status so client can detect error
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
//delete VLC; //can't be re-enabled due to access to already freed memory in bonus system
|
delete VLC;
|
||||||
|
VLC = nullptr;
|
||||||
CResourceHandler::clear();
|
CResourceHandler::clear();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user