I am trying to catch a memory leak, basically, my FreeTypeFont::d_fontData is not destroyed, and I don't know why (all the other resources allocated by CEGUI are being freed up).
I am using the latest version from the source repository.
I am instancing my GUI from Lua (see whole script below).
The d_fontData is being allocated in FreeTypeFont:updateFon():
Code: Select all
System::getSingleton().getResourceProvider()->loadRawDataContainer(
d_filename, d_fontData, d_resourceGroup.empty() ?
getDefaultResourceGroup() : d_resourceGroup);
Shall I manually delete it ? That doesn't sound right, as I am not instancing it by myself... What am I doing wrong (or actually not doing) ?
Thanks,
Below the script I am using:
Code: Select all
local oScriptInterface = imScriptInterface.g_TheScriptInterface;
local oScene = oScriptInterface:GetActiveScene();
local oSimManager = imSimManager.g_TheSimManager;
local oDrivingSim = oSimManager:GetDrivingSimulator();
local bFirstUpdate = 1;
-------------------------------------------------------------------------------------------------
function updateHandler(args)
local root = CEGUI.System:getSingleton():getDefaultGUIContext():getRootWindow()
local sBrakeForceText = oDrivingSim:ScriptGetBrakeForcePerSecSqPerKg();
root:getChild("root/ADTTuningWindow/EditboxBrakeForceCurrent"):setText(sBrakeForceText)
local sFrictionText = oDrivingSim:ScriptGetFrictionRatio();
root:getChild("root/ADTTuningWindow/EditboxFrictionCurrent"):setText(sFrictionText)
if (bFirstUpdate == 1) then
root:getChild("root/ADTTuningWindow/EditboxBrakeForceNew"):setText(sBrakeForceText)
root:getChild("root/ADTTuningWindow/EditboxFrictionNew"):setText(sFrictionText)
bFirstUpdate = 0
end
end
-------------------------------------------------------------------------------------------------
-----------------------------------------
-- Script Entry Point
-----------------------------------------
local guiSystem = CEGUI.System:getSingleton()
local schemeMgr = CEGUI.SchemeManager:getSingleton()
local winMgr = CEGUI.WindowManager:getSingleton()
-- load our scheme
local scheme = schemeMgr:createFromFile("AlfiskoSkin.scheme");
-- load our window layout
local window = winMgr:loadLayoutFromFile("ADTTuning.layout")
-- set the layout as the root
local root = CEGUI.System:getSingleton():getDefaultGUIContext():getRootWindow()
root:addChild(window);
-- set default mouse cursor
guiSystem:getDefaultGUIContext():getMouseCursor():setDefaultImage("AlfiskoSkin/MouseArrow")
-- subscribe required events
root:getChild("root/ADTTuningWindow"):subscribeEvent("Updated", "updateHandler")