OSDN Git Service

SDL_GetPrefPath サンプルコードを修正
authormaruhiro <maruhiro@bridge.ocn.ne.jp>
Sat, 9 May 2015 02:23:35 +0000 (11:23 +0900)
committermaruhiro <maruhiro@bridge.ocn.ne.jp>
Sat, 9 May 2015 02:23:35 +0000 (11:23 +0900)
SDL_GetPrefPath.html

index 4f4adbe..df3544d 100644 (file)
@@ -40,8 +40,7 @@ char *pref_path = NULL;
 void InitializePrefPath() {\r
     char *base_path = SDL_GetPrefPath("My Company", "My Awesome SDL 2 Game");\r
     if (base_path) {\r
-        pref_path = SDL_strdup(base_path);\r
-        SDL_free(base_path);\r
+        pref_path = base_path;\r
     } else {\r
         /* \83Q\81[\83\80\82Å\8fî\95ñ\82ð\8f\91\82©\82È\82¢\82æ\82¤\82É\82·\82é\8f\88\97\9d\82ð\82±\82±\82É\8f\91\82­ */\r
     }\r