UI/obs-frontend-api: Return allocated strings for new funcs

8dda8d3500 added a few functions to get the last
recording/replay/screenshot path, but it should return allocations
because it's possible for the data to be modified at a later point.
This commit is contained in:
Jim committed 2022-10-30 20:35:36 -07:00
1 parent 8dda8d3500
commit 1fc6c50b62
5 files changed
+23 -21

No files matched your search

+6 -6
View File
@@ -647,19 +647,19 @@ struct OBSStudioAPI : obs_frontend_callbacks {
return App()->IsThemeDark();
}
const char *obs_frontend_get_last_recording(void) override
char *obs_frontend_get_last_recording(void) override
{
return main->outputHandler->lastRecordingPath.c_str();
return bstrdup(main->outputHandler->lastRecordingPath.c_str());
}
const char *obs_frontend_get_last_screenshot(void) override
char *obs_frontend_get_last_screenshot(void) override
{
return main->lastScreenshot.c_str();
return bstrdup(main->lastScreenshot.c_str());
}
const char *obs_frontend_get_last_replay(void) override
char *obs_frontend_get_last_replay(void) override
{
return main->lastReplay.c_str();
return bstrdup(main->lastReplay.c_str());
}
void on_load(obs_data_t *settings) override