diff --git a/src/user/main.cpp b/src/user/main.cpp index aadb71c..a34477f 100644 --- a/src/user/main.cpp +++ b/src/user/main.cpp @@ -10,12 +10,10 @@ bool mainEnd = false; bool displayed = false; #ifdef _DEBUG -SceVoid leakTestTask(void) +SceVoid leakTestTask(ScePVoid argp) { - Allocator *glAlloc = Allocator::GetGlobalAllocator(); - SceInt32 sz = glAlloc->GetFreeSize(); - - SCE_DBG_LOG_INFO("Free heap memory: %d\n", sz); + if(imposePlugin == NULL) return; + print("Free heap memory: %d\n", imposePlugin->memoryPool->GetFreeSize()); } #endif @@ -34,9 +32,6 @@ SceInt32 VblankCallback(SceUID notifyId, SceInt32 notifyCount, SceInt32 notifyAr //Delay to make sure it displays it at the end sceKernelDelayThread(1000); -#ifdef _DEBUG - leakTestTask(); -#endif displayed = true; displayWidgets(); @@ -52,6 +47,10 @@ int impose_thread(SceSize, void *) { //Delay to let shell load properly sceKernelDelayThread(4 * 1000 * 1000); + + #ifdef _DEBUG + common::Utils::AddMainThreadTask(leakTestTask, NULL); + #endif SceUID CallbackUID = sceKernelCreateCallback("QMR_VblankCB", 0, VblankCallback, NULL); if (CallbackUID < 0) diff --git a/src/user/utils.cpp b/src/user/utils.cpp index 52c4cf9..8e1b722 100644 --- a/src/user/utils.cpp +++ b/src/user/utils.cpp @@ -163,7 +163,7 @@ SceInt32 Utils::CreateTextureFromFile(graphics::Texture *tex, const char *file) if(err < 0) return err; - graphics::Texture::CreateFromFile(tex, imposePlugin->memoryPool, &openResult); + graphics::Texture::CreateFromFile(tex, QuickMenuRebornPlugin->memoryPool, &openResult); openResult.cleanup->cb(openResult.object); delete openResult.cleanup;