On 01/14/2016 03:57 PM, Gerald Nunn wrote:
OK so looking into this more, it looks like the issue is that an RGBA struct is being freed twice for some reason as it is consistently failing on the RGBA destructor as per the stack trace below from GDB. In my code I allocate an RGBA array for the palette and this allocation seems to be triggering the D GC which in term calls the RGBA destructor and attempt to call gdkrgbafree.
I'm a bit confused on RGBA works in GTK since it is a struct and not a GObject, am I correct in assuming that it is not reference counted or is there something covert happening under the hood?
Also, how are references to this struct managed. For example, when I pass an RGBA to the VTE widget, who's responsible for calling gdkrgbafree, me (i.e. GtkD) or VTE? I checked the VTE source code and don't see any gdkrgbafree so I assume it's the caller?
If that's the case, does this mean I need to maintain persistent references to the RGBA class to ensure the RGBA class doesn't go out of scope and D garbage collects while a widget is still referencing the underlying struct?
vte.setColors is copying the colors, so it shouldn't cause any problems.
I'll try finding out where is the error is coming from.