Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mariotaku committed Jan 19, 2024
1 parent c09bcf1 commit 536059d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/core/webos/SDL_webos_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ SDL_bool SDL_webOSSetLSHandle(LSHandle *handle)
return HELPERS_HNDLSetLSHandle != NULL;
}

void SDL_webOSInitLSHandle(){
void SDL_webOSInitLSHandle()
{
if (HELPERS_HNDLSetLSHandle != NULL && s_LSHandle != NULL) {
HELPERS_HNDLSetLSHandle(s_LSHandle);
}
Expand Down Expand Up @@ -110,7 +111,7 @@ int getNativeLifeCycleInterfaceVersion(const char *appId)
}
parsed = SDL_webOSJsonParse(output, &parser, 1);
if (parsed == NULL) {
SDL_free(output);
free(output);
return SDL_SetError("Failed to parse output of luna://com.webos.applicationManager/getAppInfo");
}

Expand All @@ -123,6 +124,7 @@ int getNativeLifeCycleInterfaceVersion(const char *appId)
version = 1;
}
PBNJSON_jdomparser_release(&parser);
free(output);
return version;
}

Expand Down
5 changes: 3 additions & 2 deletions src/core/webos/SDL_webos_panelinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ SDL_bool SDL_webOSGetPanelResolution(int *width, int *height) {
result = SDL_TRUE;
PBNJSON_jdomparser_release(&parser);
}
SDL_free(response);
free(response);
}
if (SDL_webOSLunaServiceCallSync("luna://com.webos.service.tv.systemproperty/getSystemInfo",
"{\"keys\": [\"UHD\"]}", 1, &response) && response != NULL) {
Expand All @@ -46,7 +46,7 @@ SDL_bool SDL_webOSGetPanelResolution(int *width, int *height) {
result = SDL_TRUE;
PBNJSON_jdomparser_release(&parser);
}
SDL_free(response);
free(response);
}
return result;
}
Expand Down Expand Up @@ -100,6 +100,7 @@ SDL_bool SDL_webOSGetRefreshRate(int *rate) {
}
PBNJSON_jdomparser_release(&parser);
}
free(response);
}
return result;
}
Expand Down
2 changes: 1 addition & 1 deletion src/locale/webos/SDL_syslocale.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen)
}
}
PBNJSON_jdomparser_release(&parser);
SDL_free(response);
free(response);
}

/* vi: set ts=4 sw=4 expandtab: */
2 changes: 1 addition & 1 deletion src/video/wayland/SDL_waylandwebos_cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ char WaylandWebOS_GetCursorSize()
}
PBNJSON_jdomparser_release(&parser);
}
SDL_free(response);
free(response);
return size;
}

Expand Down

0 comments on commit 536059d

Please sign in to comment.