mirror of
https://github.com/devkitPro/wut.git
synced 2026-09-14 14:16:04 -05:00
nn_swkbd: Fix potential memory leaks.
This commit is contained in:
@@ -189,7 +189,15 @@ Create(const CreateArg &args)
|
||||
|
||||
out:
|
||||
if (!result) {
|
||||
MEMDestroyExpHeap(sHeapHandle);
|
||||
if (sModuleHandle) {
|
||||
OSDynLoad_Release(sModuleHandle);
|
||||
sModuleHandle = NULL;
|
||||
}
|
||||
|
||||
if (sHeapHandle) {
|
||||
MEMDestroyExpHeap(sHeapHandle);
|
||||
sHeapHandle = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
OSDynLoad_SetAllocator(prevDynLoadAlloc, prevDynLoadFree);
|
||||
@@ -247,9 +255,17 @@ ConfirmUnfixAll()
|
||||
void
|
||||
Destroy()
|
||||
{
|
||||
return reinterpret_cast<decltype(&Rpl::SwkbdDestroy)>
|
||||
(sDestroy)
|
||||
();
|
||||
reinterpret_cast<decltype(&Rpl::SwkbdDestroy)>(sDestroy)();
|
||||
|
||||
if (sModuleHandle) {
|
||||
OSDynLoad_Release(sModuleHandle);
|
||||
sModuleHandle = NULL;
|
||||
}
|
||||
|
||||
if (sHeapHandle) {
|
||||
MEMDestroyExpHeap(sHeapHandle);
|
||||
sHeapHandle = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
|
||||
Reference in New Issue
Block a user