On Wed, 21 Nov 2007 21:32:49 +0100, Bo Lorentsen bl@lue.dk wrote:
At the moment, I'm not completely sure whether it is save to pass the keyfile object when emitting the signal. It might be it can already be invalid(due to free()) in the signal handler although my tests worked fine. I just don't know for sure whether g_signal_emit emits the signal instantly and wait for all connected handlers to return or whether it returns before handlers are finished. In the latter case, the passed keyfile object may become invalid because after the signal(e.g. project-open) is emitted, the keyfile object is freed.
I am no expert in GTK, but it seems like g_signal_emit is synchronous and passings along a pointer should not be a problem. Or have i
Probably, I just wanted to mention I'm not completely sure and when anyone experience problems at this point, this could be a reason.
Will you open a keyfile and pass that on project-save ?
Yes, the keyfile is created and the project's config file is written into the keyfile object, then the new project settings are written to the keyfile object and then the project-save signal is emitted with this keyfile object. When all signal handlers returned, the keyfile object is written to disk.
Anyway, I have what I need for now, now for some plugin code :-)
Hehe, so go ahead and surprise us ;-).
Regards, Enrico