Merge pull request #247 from ryanmjacobs:fix_pointer_checks
This commit is contained in:
commit
34567bc496
@ -260,8 +260,7 @@ struct PNGChunk
|
|||||||
}
|
}
|
||||||
~PNGChunk()
|
~PNGChunk()
|
||||||
{
|
{
|
||||||
if (Data)
|
delete[] Data;
|
||||||
delete[] Data;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -462,9 +462,9 @@ int register_extension()
|
|||||||
returnval = 1;
|
returnval = 1;
|
||||||
finalise:
|
finalise:
|
||||||
|
|
||||||
if(iconname) free(iconname);
|
free(iconname);
|
||||||
if(opencommand) free(opencommand);
|
free(opencommand);
|
||||||
if(currentfilename) free(currentfilename);
|
free(currentfilename);
|
||||||
|
|
||||||
return returnval;
|
return returnval;
|
||||||
#elif defined(LIN)
|
#elif defined(LIN)
|
||||||
|
@ -343,10 +343,10 @@ bool Client::DoInstallation()
|
|||||||
returnval = 1;
|
returnval = 1;
|
||||||
finalise:
|
finalise:
|
||||||
|
|
||||||
if(iconname) free(iconname);
|
free(iconname);
|
||||||
if(opencommand) free(opencommand);
|
free(opencommand);
|
||||||
if(protocolcommand) free(protocolcommand);
|
free(protocolcommand);
|
||||||
if(currentfilename) free(currentfilename);
|
free(currentfilename);
|
||||||
|
|
||||||
return returnval;
|
return returnval;
|
||||||
#elif defined(LIN)
|
#elif defined(LIN)
|
||||||
@ -681,8 +681,7 @@ void Client::Tick()
|
|||||||
|
|
||||||
if(status != 200)
|
if(status != 200)
|
||||||
{
|
{
|
||||||
if(data)
|
free(data);
|
||||||
free(data);
|
|
||||||
}
|
}
|
||||||
else if(data)
|
else if(data)
|
||||||
{
|
{
|
||||||
@ -768,8 +767,7 @@ void Client::Tick()
|
|||||||
//Do nothing
|
//Do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
if(data)
|
free(data);
|
||||||
free(data);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -952,7 +950,7 @@ RequestStatus Client::UploadSave(SaveInfo & save)
|
|||||||
{
|
{
|
||||||
if(strncmp((const char *)data, "OK", 2)!=0)
|
if(strncmp((const char *)data, "OK", 2)!=0)
|
||||||
{
|
{
|
||||||
if(gameData) delete[] gameData;
|
delete[] gameData;
|
||||||
lastError = std::string((const char *)data);
|
lastError = std::string((const char *)data);
|
||||||
free(data);
|
free(data);
|
||||||
return RequestFailure;
|
return RequestFailure;
|
||||||
@ -973,14 +971,14 @@ RequestStatus Client::UploadSave(SaveInfo & save)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
free(data);
|
free(data);
|
||||||
if(gameData) delete[] gameData;
|
delete[] gameData;
|
||||||
return RequestOkay;
|
return RequestOkay;
|
||||||
}
|
}
|
||||||
else if(data)
|
else if(data)
|
||||||
{
|
{
|
||||||
free(data);
|
free(data);
|
||||||
}
|
}
|
||||||
if(gameData) delete[] gameData;
|
delete[] gameData;
|
||||||
return RequestFailure;
|
return RequestFailure;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1400,8 +1398,7 @@ LoginStatus Client::Login(std::string username, std::string password, User & use
|
|||||||
{
|
{
|
||||||
lastError = http_ret_text(dataStatus);
|
lastError = http_ret_text(dataStatus);
|
||||||
}
|
}
|
||||||
if(data)
|
free(data);
|
||||||
free(data);
|
|
||||||
return LoginError;
|
return LoginError;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1447,12 +1444,10 @@ RequestStatus Client::DeleteSave(int saveID)
|
|||||||
lastError = http_ret_text(dataStatus);
|
lastError = http_ret_text(dataStatus);
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
if(data)
|
free(data);
|
||||||
free(data);
|
|
||||||
return RequestOkay;
|
return RequestOkay;
|
||||||
failure:
|
failure:
|
||||||
if(data)
|
free(data);
|
||||||
free(data);
|
|
||||||
return RequestFailure;
|
return RequestFailure;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1507,12 +1502,10 @@ RequestStatus Client::AddComment(int saveID, std::string comment)
|
|||||||
lastError = http_ret_text(dataStatus);
|
lastError = http_ret_text(dataStatus);
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
if(data)
|
free(data);
|
||||||
free(data);
|
|
||||||
return RequestOkay;
|
return RequestOkay;
|
||||||
failure:
|
failure:
|
||||||
if(data)
|
free(data);
|
||||||
free(data);
|
|
||||||
return RequestFailure;
|
return RequestFailure;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1563,12 +1556,10 @@ RequestStatus Client::FavouriteSave(int saveID, bool favourite)
|
|||||||
lastError = http_ret_text(dataStatus);
|
lastError = http_ret_text(dataStatus);
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
if(data)
|
free(data);
|
||||||
free(data);
|
|
||||||
return RequestOkay;
|
return RequestOkay;
|
||||||
failure:
|
failure:
|
||||||
if(data)
|
free(data);
|
||||||
free(data);
|
|
||||||
return RequestFailure;
|
return RequestFailure;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1621,12 +1612,10 @@ RequestStatus Client::ReportSave(int saveID, std::string message)
|
|||||||
lastError = http_ret_text(dataStatus);
|
lastError = http_ret_text(dataStatus);
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
if(data)
|
free(data);
|
||||||
free(data);
|
|
||||||
return RequestOkay;
|
return RequestOkay;
|
||||||
failure:
|
failure:
|
||||||
if(data)
|
free(data);
|
||||||
free(data);
|
|
||||||
return RequestFailure;
|
return RequestFailure;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1675,12 +1664,10 @@ RequestStatus Client::UnpublishSave(int saveID)
|
|||||||
lastError = http_ret_text(dataStatus);
|
lastError = http_ret_text(dataStatus);
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
if(data)
|
free(data);
|
||||||
free(data);
|
|
||||||
return RequestOkay;
|
return RequestOkay;
|
||||||
failure:
|
failure:
|
||||||
if(data)
|
free(data);
|
||||||
free(data);
|
|
||||||
return RequestFailure;
|
return RequestFailure;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1698,8 +1685,7 @@ RequestStatus Client::PublishSave(int saveID)
|
|||||||
const char *const postDatas[] = { "" };
|
const char *const postDatas[] = { "" };
|
||||||
size_t postLengths[] = { 1 };
|
size_t postLengths[] = { 1 };
|
||||||
char *data = http_multipart_post(urlStream.str().c_str(), postNames, postDatas, postLengths, userIDStream.str().c_str(), NULL, authUser.SessionID.c_str(), &dataStatus, NULL);
|
char *data = http_multipart_post(urlStream.str().c_str(), postNames, postDatas, postLengths, userIDStream.str().c_str(), NULL, authUser.SessionID.c_str(), &dataStatus, NULL);
|
||||||
if (data)
|
free(data);
|
||||||
free(data);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1795,7 +1781,7 @@ SaveInfo * Client::GetSave(int saveID, int saveDate)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (data) free(data);
|
free(data);
|
||||||
lastError = http_ret_text(dataStatus);
|
lastError = http_ret_text(dataStatus);
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -2008,8 +1994,7 @@ std::vector<SaveComment*> * Client::GetComments(int saveID, int start, int count
|
|||||||
{
|
{
|
||||||
lastError = http_ret_text(dataStatus);
|
lastError = http_ret_text(dataStatus);
|
||||||
}
|
}
|
||||||
if(data)
|
free(data);
|
||||||
free(data);
|
|
||||||
return commentArray;
|
return commentArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2057,8 +2042,7 @@ std::vector<std::pair<std::string, int> > * Client::GetTags(int start, int count
|
|||||||
{
|
{
|
||||||
lastError = http_ret_text(dataStatus);
|
lastError = http_ret_text(dataStatus);
|
||||||
}
|
}
|
||||||
if(data)
|
free(data);
|
||||||
free(data);
|
|
||||||
return tagArray;
|
return tagArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2140,8 +2124,7 @@ std::vector<SaveInfo*> * Client::SearchSaves(int start, int count, std::string q
|
|||||||
{
|
{
|
||||||
lastError = http_ret_text(dataStatus);
|
lastError = http_ret_text(dataStatus);
|
||||||
}
|
}
|
||||||
if(data)
|
free(data);
|
||||||
free(data);
|
|
||||||
return saveArray;
|
return saveArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2329,8 +2312,7 @@ std::list<std::string> * Client::RemoveTag(int saveID, std::string tag)
|
|||||||
{
|
{
|
||||||
lastError = http_ret_text(dataStatus);
|
lastError = http_ret_text(dataStatus);
|
||||||
}
|
}
|
||||||
if(data)
|
free(data);
|
||||||
free(data);
|
|
||||||
return tags;
|
return tags;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2390,8 +2372,7 @@ std::list<std::string> * Client::AddTag(int saveID, std::string tag)
|
|||||||
{
|
{
|
||||||
lastError = http_ret_text(dataStatus);
|
lastError = http_ret_text(dataStatus);
|
||||||
}
|
}
|
||||||
if(data)
|
free(data);
|
||||||
free(data);
|
|
||||||
return tags;
|
return tags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1075,17 +1075,13 @@ void GameSave::readOPS(char * data, int dataLength)
|
|||||||
fail:
|
fail:
|
||||||
//Clean up everything
|
//Clean up everything
|
||||||
bson_destroy(&b);
|
bson_destroy(&b);
|
||||||
if(freeIndices)
|
free(freeIndices);
|
||||||
free(freeIndices);
|
free(partsSimIndex);
|
||||||
if(partsSimIndex)
|
|
||||||
free(partsSimIndex);
|
|
||||||
throw ParseException(ParseException::Corrupt, "Save data corrupt");
|
throw ParseException(ParseException::Corrupt, "Save data corrupt");
|
||||||
fin:
|
fin:
|
||||||
bson_destroy(&b);
|
bson_destroy(&b);
|
||||||
if(freeIndices)
|
free(freeIndices);
|
||||||
free(freeIndices);
|
free(partsSimIndex);
|
||||||
if(partsSimIndex)
|
|
||||||
free(partsSimIndex);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameSave::readPSv(char * data, int dataLength)
|
void GameSave::readPSv(char * data, int dataLength)
|
||||||
@ -2191,28 +2187,17 @@ char * GameSave::serialiseOPS(unsigned int & dataLength)
|
|||||||
|
|
||||||
fin:
|
fin:
|
||||||
bson_destroy(&b);
|
bson_destroy(&b);
|
||||||
if(partsData)
|
free(partsData);
|
||||||
free(partsData);
|
free(wallData);
|
||||||
if(wallData)
|
free(fanData);
|
||||||
free(wallData);
|
delete[] elementCount;
|
||||||
if(fanData)
|
free(partsSaveIndex);
|
||||||
free(fanData);
|
free(soapLinkData);
|
||||||
if (elementCount)
|
free(partsPosData);
|
||||||
delete[] elementCount;
|
free(partsPosFirstMap);
|
||||||
if (partsSaveIndex)
|
free(partsPosLastMap);
|
||||||
free(partsSaveIndex);
|
free(partsPosCount);
|
||||||
if (soapLinkData)
|
free(partsPosLink);
|
||||||
free(soapLinkData);
|
|
||||||
if (partsPosData)
|
|
||||||
free(partsPosData);
|
|
||||||
if (partsPosFirstMap)
|
|
||||||
free(partsPosFirstMap);
|
|
||||||
if (partsPosLastMap)
|
|
||||||
free(partsPosLastMap);
|
|
||||||
if (partsPosCount)
|
|
||||||
free(partsPosCount);
|
|
||||||
if (partsPosLink)
|
|
||||||
free(partsPosLink);
|
|
||||||
|
|
||||||
return (char*)outputData;
|
return (char*)outputData;
|
||||||
}
|
}
|
||||||
|
@ -557,8 +557,7 @@ int http_async_req_status(void *ctx)
|
|||||||
{
|
{
|
||||||
cx->tptr = 0;
|
cx->tptr = 0;
|
||||||
cx->tlen = 0;
|
cx->tlen = 0;
|
||||||
if (cx->tbuf)
|
free(cx->tbuf);
|
||||||
free(cx->tbuf);
|
|
||||||
cx->state = HTS_RECV;
|
cx->state = HTS_RECV;
|
||||||
}
|
}
|
||||||
cx->last = now;
|
cx->last = now;
|
||||||
@ -684,11 +683,9 @@ void http_async_req_close(void *ctx)
|
|||||||
{
|
{
|
||||||
cx->keep = 1;
|
cx->keep = 1;
|
||||||
tmp = http_async_req_stop(ctx, NULL, NULL);
|
tmp = http_async_req_stop(ctx, NULL, NULL);
|
||||||
if (tmp)
|
free(tmp);
|
||||||
free(tmp);
|
|
||||||
}
|
}
|
||||||
if (cx->fdhost)
|
free(cx->fdhost);
|
||||||
free(cx->fdhost);
|
|
||||||
PCLOSE(cx->fd);
|
PCLOSE(cx->fd);
|
||||||
free(ctx);
|
free(ctx);
|
||||||
}
|
}
|
||||||
@ -1088,8 +1085,7 @@ retry:
|
|||||||
return http_async_req_stop(ctx, ret, len);
|
return http_async_req_stop(ctx, ret, len);
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
if (data)
|
free(data);
|
||||||
free(data);
|
|
||||||
if (own_plen)
|
if (own_plen)
|
||||||
free(plens);
|
free(plens);
|
||||||
if (ret)
|
if (ret)
|
||||||
@ -1278,8 +1274,7 @@ retry:
|
|||||||
return ctx;
|
return ctx;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
if (data)
|
free(data);
|
||||||
free(data);
|
|
||||||
if (own_plen)
|
if (own_plen)
|
||||||
free(plens);
|
free(plens);
|
||||||
//if (ret)
|
//if (ret)
|
||||||
|
@ -65,9 +65,7 @@ void SaveFile::SetDisplayName(std::string displayName)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SaveFile::~SaveFile() {
|
SaveFile::~SaveFile() {
|
||||||
if(gameSave)
|
delete gameSave;
|
||||||
delete gameSave;
|
delete thumbnail;
|
||||||
if(thumbnail)
|
|
||||||
delete thumbnail;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,7 +176,6 @@ GameSave * SaveInfo::GetGameSave()
|
|||||||
|
|
||||||
void SaveInfo::SetGameSave(GameSave * saveGame)
|
void SaveInfo::SetGameSave(GameSave * saveGame)
|
||||||
{
|
{
|
||||||
if(gameSave)
|
delete gameSave;
|
||||||
delete gameSave;
|
|
||||||
gameSave = saveGame;
|
gameSave = saveGame;
|
||||||
}
|
}
|
||||||
|
@ -61,8 +61,7 @@ RequestBroker::ProcessResponse APIRequest::Process(RequestBroker & rb)
|
|||||||
//#ifdef DEBUG
|
//#ifdef DEBUG
|
||||||
std::cout << typeid(*this).name() << " Request for " << URL << " failed with status " << status << std::endl;
|
std::cout << typeid(*this).name() << " Request for " << URL << " failed with status " << status << std::endl;
|
||||||
//#endif
|
//#endif
|
||||||
if(data)
|
free(data);
|
||||||
free(data);
|
|
||||||
|
|
||||||
return RequestBroker::Failed;
|
return RequestBroker::Failed;
|
||||||
}
|
}
|
||||||
|
@ -76,8 +76,7 @@ RequestBroker::ProcessResponse ImageRequest::Process(RequestBroker & rb)
|
|||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
std::cout << typeid(*this).name() << " Request for " << URL << " failed with status " << status << std::endl;
|
std::cout << typeid(*this).name() << " Request for " << URL << " failed with status " << status << std::endl;
|
||||||
#endif
|
#endif
|
||||||
if(data)
|
free(data);
|
||||||
free(data);
|
|
||||||
|
|
||||||
return RequestBroker::Failed;
|
return RequestBroker::Failed;
|
||||||
}
|
}
|
||||||
|
@ -38,8 +38,7 @@ RequestBroker::ProcessResponse ThumbRenderRequest::Process(RequestBroker & rb)
|
|||||||
|
|
||||||
ThumbRenderRequest::~ThumbRenderRequest()
|
ThumbRenderRequest::~ThumbRenderRequest()
|
||||||
{
|
{
|
||||||
if(Save)
|
delete Save;
|
||||||
delete Save;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ThumbRenderRequest::Cleanup()
|
void ThumbRenderRequest::Cleanup()
|
||||||
|
@ -60,8 +60,7 @@ RequestBroker::ProcessResponse WebRequest::Process(RequestBroker & rb)
|
|||||||
//#ifdef DEBUG
|
//#ifdef DEBUG
|
||||||
std::cout << typeid(*this).name() << " Request for " << URL << " failed with status " << status << std::endl;
|
std::cout << typeid(*this).name() << " Request for " << URL << " failed with status " << status << std::endl;
|
||||||
//#endif
|
//#endif
|
||||||
if(data)
|
free(data);
|
||||||
free(data);
|
|
||||||
|
|
||||||
return RequestBroker::Failed;
|
return RequestBroker::Failed;
|
||||||
}
|
}
|
||||||
|
@ -317,7 +317,6 @@ void ColourPickerActivity::OnDraw()
|
|||||||
}
|
}
|
||||||
|
|
||||||
ColourPickerActivity::~ColourPickerActivity() {
|
ColourPickerActivity::~ColourPickerActivity() {
|
||||||
if(callback)
|
delete callback;
|
||||||
delete callback;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,8 +68,7 @@ ConsoleView * ConsoleController::GetView()
|
|||||||
ConsoleController::~ConsoleController() {
|
ConsoleController::~ConsoleController() {
|
||||||
if(ui::Engine::Ref().GetWindow() == consoleView)
|
if(ui::Engine::Ref().GetWindow() == consoleView)
|
||||||
ui::Engine::Ref().CloseWindow();
|
ui::Engine::Ref().CloseWindow();
|
||||||
if(callback)
|
delete callback;
|
||||||
delete callback;
|
|
||||||
delete consoleModel;
|
delete consoleModel;
|
||||||
delete consoleView;
|
delete consoleView;
|
||||||
}
|
}
|
||||||
|
@ -144,7 +144,6 @@ void ConfirmPrompt::OnDraw()
|
|||||||
}
|
}
|
||||||
|
|
||||||
ConfirmPrompt::~ConfirmPrompt() {
|
ConfirmPrompt::~ConfirmPrompt() {
|
||||||
if(callback)
|
delete callback;
|
||||||
delete callback;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +72,6 @@ void ErrorMessage::OnDraw()
|
|||||||
}
|
}
|
||||||
|
|
||||||
ErrorMessage::~ErrorMessage() {
|
ErrorMessage::~ErrorMessage() {
|
||||||
if(callback)
|
delete callback;
|
||||||
delete callback;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,7 +108,6 @@ void TextPrompt::OnDraw()
|
|||||||
}
|
}
|
||||||
|
|
||||||
TextPrompt::~TextPrompt() {
|
TextPrompt::~TextPrompt() {
|
||||||
if(callback)
|
delete callback;
|
||||||
delete callback;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -332,6 +332,5 @@ void FileBrowserActivity::OnDraw()
|
|||||||
|
|
||||||
FileBrowserActivity::~FileBrowserActivity()
|
FileBrowserActivity::~FileBrowserActivity()
|
||||||
{
|
{
|
||||||
if(callback)
|
delete callback;
|
||||||
delete callback;
|
|
||||||
}
|
}
|
||||||
|
@ -51,8 +51,7 @@ public:
|
|||||||
{
|
{
|
||||||
if(origBitmap)
|
if(origBitmap)
|
||||||
{
|
{
|
||||||
if(bitmap)
|
delete[] bitmap;
|
||||||
delete[] bitmap;
|
|
||||||
bitmap = new unsigned char[size.X*size.Y];
|
bitmap = new unsigned char[size.X*size.Y];
|
||||||
if(size == origSize)
|
if(size == origSize)
|
||||||
std::copy(origBitmap, origBitmap+(origSize.X*origSize.Y), bitmap);
|
std::copy(origBitmap, origBitmap+(origSize.X*origSize.Y), bitmap);
|
||||||
@ -88,8 +87,7 @@ public:
|
|||||||
}
|
}
|
||||||
virtual ~BitmapBrush()
|
virtual ~BitmapBrush()
|
||||||
{
|
{
|
||||||
if(origBitmap)
|
delete[] origBitmap;
|
||||||
delete[] origBitmap;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -18,8 +18,7 @@ protected:
|
|||||||
GenerateBitmap();
|
GenerateBitmap();
|
||||||
if(!bitmap)
|
if(!bitmap)
|
||||||
return;
|
return;
|
||||||
if(outline)
|
delete[] outline;
|
||||||
delete[] outline;
|
|
||||||
outline = new unsigned char[size.X*size.Y];
|
outline = new unsigned char[size.X*size.Y];
|
||||||
for(int x = 0; x < size.X; x++)
|
for(int x = 0; x < size.X; x++)
|
||||||
{
|
{
|
||||||
@ -64,10 +63,8 @@ public:
|
|||||||
updateOutline();
|
updateOutline();
|
||||||
}
|
}
|
||||||
virtual ~Brush() {
|
virtual ~Brush() {
|
||||||
if(bitmap)
|
delete[] bitmap;
|
||||||
delete[] bitmap;
|
delete[] outline;
|
||||||
if(outline)
|
|
||||||
delete[] outline;
|
|
||||||
}
|
}
|
||||||
virtual void RenderRect(Renderer * ren, ui::Point position1, ui::Point position2);
|
virtual void RenderRect(Renderer * ren, ui::Point position1, ui::Point position2);
|
||||||
virtual void RenderLine(Renderer * ren, ui::Point position1, ui::Point position2);
|
virtual void RenderLine(Renderer * ren, ui::Point position1, ui::Point position2);
|
||||||
@ -75,8 +72,7 @@ public:
|
|||||||
virtual void RenderFill(Renderer * ren, ui::Point position);
|
virtual void RenderFill(Renderer * ren, ui::Point position);
|
||||||
virtual void GenerateBitmap()
|
virtual void GenerateBitmap()
|
||||||
{
|
{
|
||||||
if(bitmap)
|
delete[] bitmap;
|
||||||
delete[] bitmap;
|
|
||||||
bitmap = new unsigned char[size.X*size.Y];
|
bitmap = new unsigned char[size.X*size.Y];
|
||||||
for(int x = 0; x < size.X; x++)
|
for(int x = 0; x < size.X; x++)
|
||||||
{
|
{
|
||||||
|
@ -14,8 +14,7 @@ public:
|
|||||||
}
|
}
|
||||||
virtual void GenerateBitmap()
|
virtual void GenerateBitmap()
|
||||||
{
|
{
|
||||||
if(bitmap)
|
delete[] bitmap;
|
||||||
delete[] bitmap;
|
|
||||||
bitmap = new unsigned char[size.X*size.Y];
|
bitmap = new unsigned char[size.X*size.Y];
|
||||||
int rx = radius.X;
|
int rx = radius.X;
|
||||||
int ry = radius.Y;
|
int ry = radius.Y;
|
||||||
|
@ -1223,8 +1223,7 @@ void GameController::OpenTags()
|
|||||||
{
|
{
|
||||||
if(gameModel->GetSave() && gameModel->GetSave()->GetID())
|
if(gameModel->GetSave() && gameModel->GetSave()->GetID())
|
||||||
{
|
{
|
||||||
if (tagsWindow)
|
delete tagsWindow;
|
||||||
delete tagsWindow;
|
|
||||||
tagsWindow = new TagsController(new TagsCallback(this), gameModel->GetSave());
|
tagsWindow = new TagsController(new TagsCallback(this), gameModel->GetSave());
|
||||||
ui::Engine::Ref().ShowWindow(tagsWindow->GetView());
|
ui::Engine::Ref().ShowWindow(tagsWindow->GetView());
|
||||||
}
|
}
|
||||||
|
@ -176,14 +176,10 @@ GameModel::~GameModel()
|
|||||||
}
|
}
|
||||||
delete sim;
|
delete sim;
|
||||||
delete ren;
|
delete ren;
|
||||||
if(placeSave)
|
delete placeSave;
|
||||||
delete placeSave;
|
delete clipboard;
|
||||||
if(clipboard)
|
delete currentSave;
|
||||||
delete clipboard;
|
delete currentFile;
|
||||||
if(currentSave)
|
|
||||||
delete currentSave;
|
|
||||||
if(currentFile)
|
|
||||||
delete currentFile;
|
|
||||||
//if(activeTools)
|
//if(activeTools)
|
||||||
// delete[] activeTools;
|
// delete[] activeTools;
|
||||||
}
|
}
|
||||||
@ -556,15 +552,13 @@ void GameModel::SetSave(SaveInfo * newSave)
|
|||||||
{
|
{
|
||||||
if(currentSave != newSave)
|
if(currentSave != newSave)
|
||||||
{
|
{
|
||||||
if(currentSave)
|
delete currentSave;
|
||||||
delete currentSave;
|
|
||||||
if(newSave == NULL)
|
if(newSave == NULL)
|
||||||
currentSave = NULL;
|
currentSave = NULL;
|
||||||
else
|
else
|
||||||
currentSave = new SaveInfo(*newSave);
|
currentSave = new SaveInfo(*newSave);
|
||||||
}
|
}
|
||||||
if(currentFile)
|
delete currentFile;
|
||||||
delete currentFile;
|
|
||||||
currentFile = NULL;
|
currentFile = NULL;
|
||||||
|
|
||||||
if(currentSave && currentSave->GetGameSave())
|
if(currentSave && currentSave->GetGameSave())
|
||||||
@ -599,15 +593,13 @@ void GameModel::SetSaveFile(SaveFile * newSave)
|
|||||||
{
|
{
|
||||||
if(currentFile != newSave)
|
if(currentFile != newSave)
|
||||||
{
|
{
|
||||||
if(currentFile)
|
delete currentFile;
|
||||||
delete currentFile;
|
|
||||||
if(newSave == NULL)
|
if(newSave == NULL)
|
||||||
currentFile = NULL;
|
currentFile = NULL;
|
||||||
else
|
else
|
||||||
currentFile = new SaveFile(*newSave);
|
currentFile = new SaveFile(*newSave);
|
||||||
}
|
}
|
||||||
if (currentSave)
|
delete currentSave;
|
||||||
delete currentSave;
|
|
||||||
currentSave = NULL;
|
currentSave = NULL;
|
||||||
|
|
||||||
if(newSave && newSave->GetGameSave())
|
if(newSave && newSave->GetGameSave())
|
||||||
@ -907,8 +899,7 @@ void GameModel::SetPlaceSave(GameSave * save)
|
|||||||
{
|
{
|
||||||
if(save != placeSave)
|
if(save != placeSave)
|
||||||
{
|
{
|
||||||
if(placeSave)
|
delete placeSave;
|
||||||
delete placeSave;
|
|
||||||
if(save)
|
if(save)
|
||||||
placeSave = new GameSave(*save);
|
placeSave = new GameSave(*save);
|
||||||
else
|
else
|
||||||
@ -919,8 +910,7 @@ void GameModel::SetPlaceSave(GameSave * save)
|
|||||||
|
|
||||||
void GameModel::SetClipboard(GameSave * save)
|
void GameModel::SetClipboard(GameSave * save)
|
||||||
{
|
{
|
||||||
if(clipboard)
|
delete clipboard;
|
||||||
delete clipboard;
|
|
||||||
clipboard = save;
|
clipboard = save;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,8 +142,7 @@ public:
|
|||||||
}
|
}
|
||||||
virtual ~SplitButton()
|
virtual ~SplitButton()
|
||||||
{
|
{
|
||||||
if(splitActionCallback)
|
delete splitActionCallback;
|
||||||
delete splitActionCallback;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -460,8 +459,7 @@ GameView::~GameView()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(placeSaveThumb)
|
delete placeSaveThumb;
|
||||||
delete placeSaveThumb;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class GameView::MenuAction: public ui::ButtonAction
|
class GameView::MenuAction: public ui::ButtonAction
|
||||||
@ -728,8 +726,7 @@ void GameView::NotifyToolListChanged(GameModel * sender)
|
|||||||
tempButton->SetActionCallback(new ToolAction(this, toolList[i]));
|
tempButton->SetActionCallback(new ToolAction(this, toolList[i]));
|
||||||
|
|
||||||
tempButton->Appearance.SetTexture(tempTexture);
|
tempButton->Appearance.SetTexture(tempTexture);
|
||||||
if(tempTexture)
|
delete tempTexture;
|
||||||
delete tempTexture;
|
|
||||||
|
|
||||||
tempButton->Appearance.BackgroundInactive = ui::Colour(toolList[i]->colRed, toolList[i]->colGreen, toolList[i]->colBlue);
|
tempButton->Appearance.BackgroundInactive = ui::Colour(toolList[i]->colRed, toolList[i]->colGreen, toolList[i]->colBlue);
|
||||||
|
|
||||||
@ -1867,8 +1864,7 @@ void GameView::NotifyLogChanged(GameModel * sender, string entry)
|
|||||||
|
|
||||||
void GameView::NotifyPlaceSaveChanged(GameModel * sender)
|
void GameView::NotifyPlaceSaveChanged(GameModel * sender)
|
||||||
{
|
{
|
||||||
if(placeSaveThumb)
|
delete placeSaveThumb;
|
||||||
delete placeSaveThumb;
|
|
||||||
if(sender->GetPlaceSave())
|
if(sender->GetPlaceSave())
|
||||||
{
|
{
|
||||||
placeSaveThumb = SaveRenderer::Ref().Render(sender->GetPlaceSave());
|
placeSaveThumb = SaveRenderer::Ref().Render(sender->GetPlaceSave());
|
||||||
|
@ -21,8 +21,7 @@ public:
|
|||||||
};
|
};
|
||||||
virtual void GenerateBitmap()
|
virtual void GenerateBitmap()
|
||||||
{
|
{
|
||||||
if(bitmap)
|
delete[] bitmap;
|
||||||
delete[] bitmap;
|
|
||||||
bitmap = new unsigned char[size.X*size.Y];
|
bitmap = new unsigned char[size.X*size.Y];
|
||||||
int rx = radius.X;
|
int rx = radius.X;
|
||||||
int ry = radius.Y;
|
int ry = radius.Y;
|
||||||
|
@ -37,8 +37,7 @@ namespace ui
|
|||||||
|
|
||||||
void Appearance::SetTexture(VideoBuffer * texture)
|
void Appearance::SetTexture(VideoBuffer * texture)
|
||||||
{
|
{
|
||||||
if(this->texture)
|
delete this->texture;
|
||||||
delete this->texture;
|
|
||||||
if(texture)
|
if(texture)
|
||||||
this->texture = new VideoBuffer(texture);
|
this->texture = new VideoBuffer(texture);
|
||||||
else
|
else
|
||||||
@ -47,8 +46,7 @@ namespace ui
|
|||||||
|
|
||||||
Appearance::~Appearance()
|
Appearance::~Appearance()
|
||||||
{
|
{
|
||||||
if(texture)
|
delete texture;
|
||||||
delete texture;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -25,10 +25,8 @@ AvatarButton::AvatarButton(Point position, Point size, std::string username):
|
|||||||
AvatarButton::~AvatarButton()
|
AvatarButton::~AvatarButton()
|
||||||
{
|
{
|
||||||
RequestBroker::Ref().DetachRequestListener(this);
|
RequestBroker::Ref().DetachRequestListener(this);
|
||||||
if(avatar)
|
delete avatar;
|
||||||
delete avatar;
|
delete actionCallback;
|
||||||
if(actionCallback)
|
|
||||||
delete actionCallback;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AvatarButton::Tick(float dt)
|
void AvatarButton::Tick(float dt)
|
||||||
@ -45,8 +43,7 @@ void AvatarButton::OnResponseReady(void * imagePtr, int identifier)
|
|||||||
VideoBuffer * image = (VideoBuffer*)imagePtr;
|
VideoBuffer * image = (VideoBuffer*)imagePtr;
|
||||||
if(image)
|
if(image)
|
||||||
{
|
{
|
||||||
if(avatar)
|
delete avatar;
|
||||||
delete avatar;
|
|
||||||
avatar = image;
|
avatar = image;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -219,15 +219,13 @@ void Button::DoAltAction()
|
|||||||
|
|
||||||
void Button::SetActionCallback(ButtonAction * action)
|
void Button::SetActionCallback(ButtonAction * action)
|
||||||
{
|
{
|
||||||
if(actionCallback)
|
delete actionCallback;
|
||||||
delete actionCallback;
|
|
||||||
actionCallback = action;
|
actionCallback = action;
|
||||||
}
|
}
|
||||||
|
|
||||||
Button::~Button()
|
Button::~Button()
|
||||||
{
|
{
|
||||||
if(actionCallback)
|
delete actionCallback;
|
||||||
delete actionCallback;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} /* namespace ui */
|
} /* namespace ui */
|
||||||
|
@ -96,13 +96,11 @@ void Checkbox::Draw(const Point& screenPos)
|
|||||||
|
|
||||||
void Checkbox::SetActionCallback(CheckboxAction * action)
|
void Checkbox::SetActionCallback(CheckboxAction * action)
|
||||||
{
|
{
|
||||||
if(actionCallback)
|
delete actionCallback;
|
||||||
delete actionCallback;
|
|
||||||
actionCallback = action;
|
actionCallback = action;
|
||||||
}
|
}
|
||||||
|
|
||||||
Checkbox::~Checkbox() {
|
Checkbox::~Checkbox() {
|
||||||
if(actionCallback)
|
delete actionCallback;
|
||||||
delete actionCallback;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -239,6 +239,5 @@ void Component::OnMouseWheelInside(int localx, int localy, int d)
|
|||||||
|
|
||||||
Component::~Component()
|
Component::~Component()
|
||||||
{
|
{
|
||||||
if(menu)
|
delete menu;
|
||||||
delete menu;
|
|
||||||
}
|
}
|
||||||
|
@ -190,8 +190,7 @@ void DropDown::OnMouseLeave(int x, int y)
|
|||||||
|
|
||||||
|
|
||||||
DropDown::~DropDown() {
|
DropDown::~DropDown() {
|
||||||
if(callback)
|
delete callback;
|
||||||
delete callback;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} /* namespace ui */
|
} /* namespace ui */
|
||||||
|
@ -39,16 +39,14 @@ Engine::Engine():
|
|||||||
|
|
||||||
Engine::~Engine()
|
Engine::~Engine()
|
||||||
{
|
{
|
||||||
if(state_ != NULL)
|
delete state_;
|
||||||
delete state_;
|
|
||||||
//Dispose of any Windows.
|
//Dispose of any Windows.
|
||||||
while(!windows.empty())
|
while(!windows.empty())
|
||||||
{
|
{
|
||||||
delete windows.top();
|
delete windows.top();
|
||||||
windows.pop();
|
windows.pop();
|
||||||
}
|
}
|
||||||
if (lastBuffer)
|
free(lastBuffer);
|
||||||
free(lastBuffer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Engine::Begin(int width, int height)
|
void Engine::Begin(int width, int height)
|
||||||
|
@ -46,8 +46,7 @@ Panel::~Panel()
|
|||||||
{
|
{
|
||||||
for(unsigned i = 0; i < children.size(); ++i)
|
for(unsigned i = 0; i < children.size(); ++i)
|
||||||
{
|
{
|
||||||
if( children[i] )
|
delete children[i];
|
||||||
delete children[i];
|
|
||||||
}
|
}
|
||||||
#ifdef OGLI
|
#ifdef OGLI
|
||||||
glDeleteTextures(1, &myVidTex);
|
glDeleteTextures(1, &myVidTex);
|
||||||
|
@ -118,14 +118,10 @@ SaveButton::~SaveButton()
|
|||||||
{
|
{
|
||||||
RequestBroker::Ref().DetachRequestListener(this);
|
RequestBroker::Ref().DetachRequestListener(this);
|
||||||
|
|
||||||
if(thumbnail)
|
delete thumbnail;
|
||||||
delete thumbnail;
|
delete actionCallback;
|
||||||
if(actionCallback)
|
delete save;
|
||||||
delete actionCallback;
|
delete file;
|
||||||
if(save)
|
|
||||||
delete save;
|
|
||||||
if(file)
|
|
||||||
delete file;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SaveButton::OnResponseReady(void * imagePtr, int identifier)
|
void SaveButton::OnResponseReady(void * imagePtr, int identifier)
|
||||||
@ -133,8 +129,7 @@ void SaveButton::OnResponseReady(void * imagePtr, int identifier)
|
|||||||
VideoBuffer * image = (VideoBuffer*)imagePtr;
|
VideoBuffer * image = (VideoBuffer*)imagePtr;
|
||||||
if(image)
|
if(image)
|
||||||
{
|
{
|
||||||
if(thumbnail)
|
delete thumbnail;
|
||||||
delete thumbnail;
|
|
||||||
thumbnail = image;
|
thumbnail = image;
|
||||||
waitingForThumb = false;
|
waitingForThumb = false;
|
||||||
}
|
}
|
||||||
|
@ -68,8 +68,7 @@ void Slider::SetColour(Colour col1, Colour col2)
|
|||||||
{
|
{
|
||||||
pixel pix[2] = {(pixel)PIXRGB(col1.Red, col1.Green, col1.Blue), (pixel)PIXRGB(col2.Red, col2.Green, col2.Blue)};
|
pixel pix[2] = {(pixel)PIXRGB(col1.Red, col1.Green, col1.Blue), (pixel)PIXRGB(col2.Red, col2.Green, col2.Blue)};
|
||||||
float fl[2] = {0.0f, 1.0f};
|
float fl[2] = {0.0f, 1.0f};
|
||||||
if(bgGradient)
|
free(bgGradient);
|
||||||
free(bgGradient);
|
|
||||||
this->col1 = col1;
|
this->col1 = col1;
|
||||||
this->col2 = col2;
|
this->col2 = col2;
|
||||||
bgGradient = (unsigned char*)Graphics::GenerateGradient(pix, fl, 2, Size.X-7);
|
bgGradient = (unsigned char*)Graphics::GenerateGradient(pix, fl, 2, Size.X-7);
|
||||||
|
@ -35,8 +35,7 @@ Textbox::Textbox(Point position, Point size, std::string textboxText, std::strin
|
|||||||
|
|
||||||
Textbox::~Textbox()
|
Textbox::~Textbox()
|
||||||
{
|
{
|
||||||
if(actionCallback)
|
delete actionCallback;
|
||||||
delete actionCallback;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Textbox::SetHidden(bool hidden)
|
void Textbox::SetHidden(bool hidden)
|
||||||
@ -566,8 +565,7 @@ Textbox::Textbox(Point position, Point size, std::string textboxText):
|
|||||||
|
|
||||||
Textbox::~Textbox()
|
Textbox::~Textbox()
|
||||||
{
|
{
|
||||||
if(actionCallback)
|
delete actionCallback;
|
||||||
delete actionCallback;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Textbox::TextPosition()
|
void Textbox::TextPosition()
|
||||||
|
@ -176,8 +176,7 @@ void LocalBrowserController::Exit()
|
|||||||
LocalBrowserController::~LocalBrowserController() {
|
LocalBrowserController::~LocalBrowserController() {
|
||||||
if(ui::Engine::Ref().GetWindow() == browserView)
|
if(ui::Engine::Ref().GetWindow() == browserView)
|
||||||
ui::Engine::Ref().CloseWindow();
|
ui::Engine::Ref().CloseWindow();
|
||||||
if(callback)
|
delete callback;
|
||||||
delete callback;
|
|
||||||
delete browserModel;
|
delete browserModel;
|
||||||
delete browserView;
|
delete browserView;
|
||||||
}
|
}
|
||||||
|
@ -50,8 +50,7 @@ SaveFile * LocalBrowserModel::GetSave()
|
|||||||
|
|
||||||
void LocalBrowserModel::SetSave(SaveFile * newStamp)
|
void LocalBrowserModel::SetSave(SaveFile * newStamp)
|
||||||
{
|
{
|
||||||
if(stamp)
|
delete stamp;
|
||||||
delete stamp;
|
|
||||||
stamp = new SaveFile(*newStamp);
|
stamp = new SaveFile(*newStamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,7 +140,6 @@ void LocalBrowserModel::notifySelectedChanged()
|
|||||||
}
|
}
|
||||||
|
|
||||||
LocalBrowserModel::~LocalBrowserModel() {
|
LocalBrowserModel::~LocalBrowserModel() {
|
||||||
if(stamp)
|
delete stamp;
|
||||||
delete stamp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,7 +105,6 @@ OptionsController::~OptionsController() {
|
|||||||
}
|
}
|
||||||
delete model;
|
delete model;
|
||||||
delete view;
|
delete view;
|
||||||
if(callback)
|
delete callback;
|
||||||
delete callback;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,7 +192,6 @@ PreviewController::~PreviewController() {
|
|||||||
Client::Ref().RemoveListener(this);
|
Client::Ref().RemoveListener(this);
|
||||||
delete previewModel;
|
delete previewModel;
|
||||||
delete previewView;
|
delete previewView;
|
||||||
if(callback)
|
delete callback;
|
||||||
delete callback;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,14 +139,12 @@ void PreviewModel::OnResponseReady(void * object, int identifier)
|
|||||||
{
|
{
|
||||||
if (identifier == 1)
|
if (identifier == 1)
|
||||||
{
|
{
|
||||||
if (saveData)
|
delete saveData;
|
||||||
delete saveData;
|
|
||||||
saveData = (std::vector<unsigned char>*)object;
|
saveData = (std::vector<unsigned char>*)object;
|
||||||
}
|
}
|
||||||
if (identifier == 2)
|
if (identifier == 2)
|
||||||
{
|
{
|
||||||
if (save)
|
delete save;
|
||||||
delete save;
|
|
||||||
save = (SaveInfo*)object;
|
save = (SaveInfo*)object;
|
||||||
}
|
}
|
||||||
if (identifier == 3)
|
if (identifier == 3)
|
||||||
@ -243,10 +241,8 @@ void PreviewModel::AddObserver(PreviewView * observer)
|
|||||||
PreviewModel::~PreviewModel()
|
PreviewModel::~PreviewModel()
|
||||||
{
|
{
|
||||||
RequestBroker::Ref().DetachRequestListener(this);
|
RequestBroker::Ref().DetachRequestListener(this);
|
||||||
if (save)
|
delete save;
|
||||||
delete save;
|
delete saveData;
|
||||||
if (saveData)
|
|
||||||
delete saveData;
|
|
||||||
if (saveComments)
|
if (saveComments)
|
||||||
{
|
{
|
||||||
for (size_t i = 0; i < saveComments->size(); i++)
|
for (size_t i = 0; i < saveComments->size(); i++)
|
||||||
|
@ -408,8 +408,7 @@ void PreviewView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, b
|
|||||||
void PreviewView::NotifySaveChanged(PreviewModel * sender)
|
void PreviewView::NotifySaveChanged(PreviewModel * sender)
|
||||||
{
|
{
|
||||||
SaveInfo * save = sender->GetSave();
|
SaveInfo * save = sender->GetSave();
|
||||||
if(savePreview)
|
delete savePreview;
|
||||||
delete savePreview;
|
|
||||||
savePreview = NULL;
|
savePreview = NULL;
|
||||||
if(save)
|
if(save)
|
||||||
{
|
{
|
||||||
@ -624,7 +623,6 @@ PreviewView::~PreviewView()
|
|||||||
RemoveComponent(submitCommentButton);
|
RemoveComponent(submitCommentButton);
|
||||||
delete submitCommentButton;
|
delete submitCommentButton;
|
||||||
}
|
}
|
||||||
if(savePreview)
|
delete savePreview;
|
||||||
delete savePreview;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,8 +59,7 @@ RenderController::~RenderController() {
|
|||||||
{
|
{
|
||||||
ui::Engine::Ref().CloseWindow();
|
ui::Engine::Ref().CloseWindow();
|
||||||
}
|
}
|
||||||
if(callback)
|
delete callback;
|
||||||
delete callback;
|
|
||||||
delete renderModel;
|
delete renderModel;
|
||||||
delete renderView;
|
delete renderView;
|
||||||
}
|
}
|
||||||
|
@ -135,16 +135,13 @@ void LocalSaveActivity::OnDraw()
|
|||||||
|
|
||||||
void LocalSaveActivity::OnResponseReady(void * imagePtr, int identifier)
|
void LocalSaveActivity::OnResponseReady(void * imagePtr, int identifier)
|
||||||
{
|
{
|
||||||
if(thumbnail)
|
delete thumbnail;
|
||||||
delete thumbnail;
|
|
||||||
thumbnail = (VideoBuffer*)imagePtr;
|
thumbnail = (VideoBuffer*)imagePtr;
|
||||||
}
|
}
|
||||||
|
|
||||||
LocalSaveActivity::~LocalSaveActivity()
|
LocalSaveActivity::~LocalSaveActivity()
|
||||||
{
|
{
|
||||||
RequestBroker::Ref().DetachRequestListener(this);
|
RequestBroker::Ref().DetachRequestListener(this);
|
||||||
if(thumbnail)
|
delete thumbnail;
|
||||||
delete thumbnail;
|
delete callback;
|
||||||
if(callback)
|
|
||||||
delete callback;
|
|
||||||
}
|
}
|
||||||
|
@ -358,18 +358,14 @@ void ServerSaveActivity::OnDraw()
|
|||||||
|
|
||||||
void ServerSaveActivity::OnResponseReady(void * imagePtr, int identifier)
|
void ServerSaveActivity::OnResponseReady(void * imagePtr, int identifier)
|
||||||
{
|
{
|
||||||
if(thumbnail)
|
delete thumbnail;
|
||||||
delete thumbnail;
|
|
||||||
thumbnail = (VideoBuffer *)imagePtr;
|
thumbnail = (VideoBuffer *)imagePtr;
|
||||||
}
|
}
|
||||||
|
|
||||||
ServerSaveActivity::~ServerSaveActivity()
|
ServerSaveActivity::~ServerSaveActivity()
|
||||||
{
|
{
|
||||||
RequestBroker::Ref().DetachRequestListener(this);
|
RequestBroker::Ref().DetachRequestListener(this);
|
||||||
if(saveUploadTask)
|
delete saveUploadTask;
|
||||||
delete saveUploadTask;
|
delete callback;
|
||||||
if(callback)
|
delete thumbnail;
|
||||||
delete callback;
|
|
||||||
if(thumbnail)
|
|
||||||
delete thumbnail;
|
|
||||||
}
|
}
|
||||||
|
@ -99,8 +99,7 @@ void SearchController::Exit()
|
|||||||
|
|
||||||
SearchController::~SearchController()
|
SearchController::~SearchController()
|
||||||
{
|
{
|
||||||
if(activePreview)
|
delete activePreview;
|
||||||
delete activePreview;
|
|
||||||
if(ui::Engine::Ref().GetWindow() == searchView)
|
if(ui::Engine::Ref().GetWindow() == searchView)
|
||||||
{
|
{
|
||||||
ui::Engine::Ref().CloseWindow();
|
ui::Engine::Ref().CloseWindow();
|
||||||
@ -204,8 +203,7 @@ void SearchController::InstantOpen(bool instant)
|
|||||||
|
|
||||||
void SearchController::OpenSave(int saveID)
|
void SearchController::OpenSave(int saveID)
|
||||||
{
|
{
|
||||||
if(activePreview)
|
delete activePreview;
|
||||||
delete activePreview;
|
|
||||||
Graphics * g = ui::Engine::Ref().g;
|
Graphics * g = ui::Engine::Ref().g;
|
||||||
g->fillrect(XRES/3, WINDOWH-20, XRES/3, 20, 0, 0, 0, 150); //dim the "Page X of Y" a little to make the CopyTextButton more noticeable
|
g->fillrect(XRES/3, WINDOWH-20, XRES/3, 20, 0, 0, 0, 150); //dim the "Page X of Y" a little to make the CopyTextButton more noticeable
|
||||||
activePreview = new PreviewController(saveID, instantOpen, new OpenCallback(this));
|
activePreview = new PreviewController(saveID, instantOpen, new OpenCallback(this));
|
||||||
@ -214,8 +212,7 @@ void SearchController::OpenSave(int saveID)
|
|||||||
|
|
||||||
void SearchController::OpenSave(int saveID, int saveDate)
|
void SearchController::OpenSave(int saveID, int saveDate)
|
||||||
{
|
{
|
||||||
if(activePreview)
|
delete activePreview;
|
||||||
delete activePreview;
|
|
||||||
Graphics * g = ui::Engine::Ref().g;
|
Graphics * g = ui::Engine::Ref().g;
|
||||||
g->fillrect(XRES/3, WINDOWH-20, XRES/3, 20, 0, 0, 0, 150); //dim the "Page X of Y" a little to make the CopyTextButton more noticeable
|
g->fillrect(XRES/3, WINDOWH-20, XRES/3, 20, 0, 0, 0, 150); //dim the "Page X of Y" a little to make the CopyTextButton more noticeable
|
||||||
activePreview = new PreviewController(saveID, saveDate, instantOpen, new OpenCallback(this));
|
activePreview = new PreviewController(saveID, saveDate, instantOpen, new OpenCallback(this));
|
||||||
|
@ -278,6 +278,5 @@ void SearchModel::notifySelectedChanged()
|
|||||||
|
|
||||||
SearchModel::~SearchModel()
|
SearchModel::~SearchModel()
|
||||||
{
|
{
|
||||||
if (loadedSave)
|
delete loadedSave;
|
||||||
delete loadedSave;
|
|
||||||
}
|
}
|
||||||
|
@ -68,6 +68,5 @@ void Thumbnail::Resize(ui::Point newSize)
|
|||||||
|
|
||||||
Thumbnail::~Thumbnail()
|
Thumbnail::~Thumbnail()
|
||||||
{
|
{
|
||||||
if(Data)
|
delete[] Data;
|
||||||
delete[] Data;
|
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,6 @@ TagsController::~TagsController() {
|
|||||||
ui::Engine::Ref().CloseWindow();
|
ui::Engine::Ref().CloseWindow();
|
||||||
delete tagsModel;
|
delete tagsModel;
|
||||||
delete tagsView;
|
delete tagsView;
|
||||||
if(callback)
|
delete callback;
|
||||||
delete callback;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,8 +42,7 @@ private:
|
|||||||
data = http_async_req_stop(request, &status, &dataLength);
|
data = http_async_req_stop(request, &status, &dataLength);
|
||||||
if (status!=200)
|
if (status!=200)
|
||||||
{
|
{
|
||||||
if (data)
|
free(data);
|
||||||
free(data);
|
|
||||||
errorStream << "Server responded with Status " << status;
|
errorStream << "Server responded with Status " << status;
|
||||||
notifyError("Could not download update");
|
notifyError("Could not download update");
|
||||||
return false;
|
return false;
|
||||||
|
@ -1944,10 +1944,10 @@ int luatpt_getscript(lua_State* l)
|
|||||||
}
|
}
|
||||||
|
|
||||||
fin:
|
fin:
|
||||||
if(filedata) free(filedata);
|
free(filedata);
|
||||||
if(fileuri) delete[] fileuri;
|
delete[] fileuri;
|
||||||
if(filename) delete[] filename;
|
delete[] filename;
|
||||||
if(luacommand) delete[] luacommand;
|
delete[] luacommand;
|
||||||
luacommand = NULL;
|
luacommand = NULL;
|
||||||
|
|
||||||
if(lastError)
|
if(lastError)
|
||||||
|
@ -45,7 +45,7 @@ public:
|
|||||||
}
|
}
|
||||||
~CoordStack()
|
~CoordStack()
|
||||||
{
|
{
|
||||||
if (stack) free(stack);
|
free(stack);
|
||||||
}
|
}
|
||||||
void push(int x, int y)
|
void push(int x, int y)
|
||||||
{
|
{
|
||||||
|
@ -140,8 +140,7 @@ VideoBuffer * SaveRenderer::Render(GameSave * save, bool decorations, bool fire)
|
|||||||
src+=WINDOWW;
|
src+=WINDOWW;
|
||||||
}
|
}
|
||||||
tempThumb = new VideoBuffer(pData, width*CELL, height*CELL);
|
tempThumb = new VideoBuffer(pData, width*CELL, height*CELL);
|
||||||
if(pData)
|
free(pData);
|
||||||
free(pData);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if(doCollapse)
|
if(doCollapse)
|
||||||
|
Reference in New Issue
Block a user