I created simple dbus service that emits signal with dynamically allocated data argument:
file_name = g_strdup("myfile");
...
...
g_signal_emit_by_name (object, "mysignal", file_name);
g_free(file_name);
In this case signal listeners may receive file_name
string that was already destroyed.
So is it safe to free file_name
right after g_signal_emit_by_name
call or I should wait for a few seconds?
Or is there any other mechanism to free memory in such cases?