From c0c1faa1e943b549ff3ae84a0767e506a917c6b5 Mon Sep 17 00:00:00 2001 From: CreeperMario Date: Sun, 6 Aug 2017 17:11:15 +0930 Subject: [PATCH] libwhb: Initialize FSCmdBlock in WHBUnmountSdCard --- samples/gx2/triangle/CMakeLists.txt | 4 +++- samples/gx2/triangle/src/main.c | 2 +- src/libwhb/src/sdcard.c | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/samples/gx2/triangle/CMakeLists.txt b/samples/gx2/triangle/CMakeLists.txt index 8ef4b23..a86a9fd 100644 --- a/samples/gx2/triangle/CMakeLists.txt +++ b/samples/gx2/triangle/CMakeLists.txt @@ -11,4 +11,6 @@ target_link_libraries(triangle defaultheap gx2 gfd - proc_ui) + nsysnet + proc_ui + sysapp) diff --git a/samples/gx2/triangle/src/main.c b/samples/gx2/triangle/src/main.c index c93277e..02deaee 100644 --- a/samples/gx2/triangle/src/main.c +++ b/samples/gx2/triangle/src/main.c @@ -113,7 +113,7 @@ exit: WHBLogPrintf("Exiting..."); GX2RDestroyBufferEx(&positionBuffer, 0); GX2RDestroyBufferEx(&colourBuffer, 0); - //WHBUnmountSdCard(); !! freezes on unmount for unkown reason !! + WHBUnmountSdCard(); WHBGfxShutdown(); WHBProcShutdown(); return result; diff --git a/src/libwhb/src/sdcard.c b/src/libwhb/src/sdcard.c index 3e2e129..83dfe52 100644 --- a/src/libwhb/src/sdcard.c +++ b/src/libwhb/src/sdcard.c @@ -67,6 +67,8 @@ WHBUnmountSdCard() return TRUE; } + FSInitCmdBlock(&cmd); + result = FSUnmount(&sClient, &cmd, sMountPath, -1); if (result < 0) { WHBLogPrintf("%s: FSUnmount error %d", __FUNCTION__, result);