equilibrier
New Member
By the way, I have on question for @bfxdev or @upgradeQ , in LUA there is a garbage collector right ? But as how I figured it out, it will only work for internal variables or specific lua data.
In case of OBS API which derivates from C/C++, I still need to free up resources...
Ok, if this is correct and maybe this will be the cause of one of my scripts actually hanging out OBS, i'm in the area of HOW, right now,
as I tried to use obs.bfree() on a variable that holds a string, and I'm stuck with an error saying that the original C function bfree expects a void* not a 'string'.
Should I make a cast in lua or something like that ?
Is it expected I free up strings (although it surely says that here: https://obsproject.com/docs/reference-frontend-api.html?highlight=replay buffer)
Is it bfree, the recommented practice to do this ? If yes, how should I use it, regarding to my above stated problem ?
and one last question: in LUA for OBS, I would only be concerned in freeing up lists and strings, as I read, right ? Lists are freed with
obs_frontend_source_list_free and strings with bfree/something else I don't know.
BTW, the two strings I tried to free with obs.bfree comes from these lines (it seems it is relevant since one seems to be using LUA functions and not obs (ported from C/C++) functions:
local nextcoll = readAll(<some file I have the name of the collection to be switched to...>)
local current_coll = obs.obs_frontend_get_current_scene_collection()
--[[...some code making the transitions...and then...]]--
obs.bfree(nextcoll)
obs.bfree(current_coll)
Thanks in advance for your answers :). Cheers !
In case of OBS API which derivates from C/C++, I still need to free up resources...
Ok, if this is correct and maybe this will be the cause of one of my scripts actually hanging out OBS, i'm in the area of HOW, right now,
as I tried to use obs.bfree() on a variable that holds a string, and I'm stuck with an error saying that the original C function bfree expects a void* not a 'string'.
Should I make a cast in lua or something like that ?
Is it expected I free up strings (although it surely says that here: https://obsproject.com/docs/reference-frontend-api.html?highlight=replay buffer)
Is it bfree, the recommented practice to do this ? If yes, how should I use it, regarding to my above stated problem ?
and one last question: in LUA for OBS, I would only be concerned in freeing up lists and strings, as I read, right ? Lists are freed with
obs_frontend_source_list_free and strings with bfree/something else I don't know.
BTW, the two strings I tried to free with obs.bfree comes from these lines (it seems it is relevant since one seems to be using LUA functions and not obs (ported from C/C++) functions:
local nextcoll = readAll(<some file I have the name of the collection to be switched to...>)
local current_coll = obs.obs_frontend_get_current_scene_collection()
--[[...some code making the transitions...and then...]]--
obs.bfree(nextcoll)
obs.bfree(current_coll)
Thanks in advance for your answers :). Cheers !