@@ -20,6 +20,8 @@ with this program. If not, see <https://www.gnu.org/licenses/>
20
20
#include < inttypes.h>
21
21
#include < QString>
22
22
23
+ #include < util/util.hpp>
24
+
23
25
#include " Obs.h"
24
26
#include " plugin-macros.generated.h"
25
27
@@ -42,33 +44,29 @@ std::string Utils::Obs::StringHelper::GetObsVersion()
42
44
43
45
std::string Utils::Obs::StringHelper::GetCurrentSceneCollection ()
44
46
{
45
- char *sceneCollectionName = obs_frontend_get_current_scene_collection ();
46
- std::string ret = sceneCollectionName;
47
- bfree (sceneCollectionName);
47
+ BPtr<char > sceneCollectionName = obs_frontend_get_current_scene_collection ();
48
+ std::string ret = sceneCollectionName.Get ();
48
49
return ret;
49
50
}
50
51
51
52
std::string Utils::Obs::StringHelper::GetCurrentProfile ()
52
53
{
53
- char *profileName = obs_frontend_get_current_profile ();
54
- std::string ret = profileName;
55
- bfree (profileName);
54
+ BPtr<char > profileName = obs_frontend_get_current_profile ();
55
+ std::string ret = profileName.Get ();
56
56
return ret;
57
57
}
58
58
59
59
std::string Utils::Obs::StringHelper::GetCurrentProfilePath ()
60
60
{
61
- char *profilePath = obs_frontend_get_current_profile_path ();
62
- std::string ret = profilePath;
63
- bfree (profilePath);
61
+ BPtr<char > profilePath = obs_frontend_get_current_profile_path ();
62
+ std::string ret = profilePath.Get ();
64
63
return ret;
65
64
}
66
65
67
66
std::string Utils::Obs::StringHelper::GetCurrentRecordOutputPath ()
68
67
{
69
- char *recordOutputPath = obs_frontend_get_current_record_output_path ();
70
- std::string ret = recordOutputPath;
71
- bfree (recordOutputPath);
68
+ BPtr<char > recordOutputPath = obs_frontend_get_current_record_output_path ();
69
+ std::string ret = recordOutputPath.Get ();
72
70
return ret;
73
71
}
74
72
@@ -94,17 +92,15 @@ std::string Utils::Obs::StringHelper::GetLastRecordFileName()
94
92
95
93
std::string Utils::Obs::StringHelper::GetLastReplayBufferFileName ()
96
94
{
97
- char *replayBufferPath = obs_frontend_get_last_replay ();
98
- std::string ret = replayBufferPath;
99
- bfree (replayBufferPath);
95
+ BPtr<char > replayBufferPath = obs_frontend_get_last_replay ();
96
+ std::string ret = replayBufferPath.Get ();
100
97
return ret;
101
98
}
102
99
103
100
std::string Utils::Obs::StringHelper::GetLastScreenshotFileName ()
104
101
{
105
- char *screenshotPath = obs_frontend_get_last_screenshot ();
106
- std::string ret = screenshotPath;
107
- bfree (screenshotPath);
102
+ BPtr<char > screenshotPath = obs_frontend_get_last_screenshot ();
103
+ std::string ret = screenshotPath.Get ();
108
104
return ret;
109
105
}
110
106
0 commit comments