GetOrCreateWidgetInfo: MainWidget info was created causing a memory leak.
Original Reporter info from Mantis: timothy902
-
Reporter name:
Original Reporter info from Mantis: timothy902
- Reporter name:
Description:
The code below is repeatedly printing the debug message "GetOrCreateWidgetInfo: MainWidget info was created causing a memory leak.", which is either a false warning or a indeed a memory leak. Sadly I could not reproduce the issue, because my first test scenario did not invoke that code.
function GetOrCreateWidgetInfo(const AWidget: Pointer): PWidgetInfo;
var
MainWidget: PGtkObject;
begin
if AWidget = nil then Exit(nil);
MainWidget := GetMainWidget(AWidget);
Result := g_object_get_data(PGObject(MainWidget), 'widgetinfo');
if Assigned(Result) then Exit;
Result := CreateWidgetInfo(MainWidget);
DebugLn('GetOrCreateWidgetInfo: MainWidget info was created causing a memory leak.');
// use the main widget as default
Result^.CoreWidget := PGtkWidget(MainWidget);
end;
Mantis conversion info:
- Mantis ID: 35987
- Build: lazarus#61730