Hi fellas,
Heads up - this is my first time ever posting on something like this, so I’m not really sure if this is the right place for it.
Basically, I have a GSocketConnection *
that I pass from a GtkApplicationWindow
via a signal to the GtkApplication
class. I’m inheriting the classes as is done in the Getting Started GTK4 documentation. I pass the object plainly via the signal and then in the application class, I initialize another GtkApplicationWindow
and have attempted to pass the socket connection object as a property in many different ways.
However, while sometimes it goes through without warning, the line I use to test the object is valid:
g_print ("%b\n", g_socket_connection_is_connected (G_SOCKET_CONNECTION (g_value_get_pointer (&sock_val))));
Always segfaults. That’s just an example of the line. Currently, I am making a reference with g_object_ref
and storing that pointer in a GValue
and then passing it and unwrapping it with g_value_get_pointer
, but I have also tried just passing it cleanly, i.e. the GSocketConnection*
object itself - still segfaults. I have tried putting the socket connection in a GValue but that also fails.
My last issue is that the constructed method that I override is being ran before my properties are set.
I know this is a lot of issues to ask for help with, and so I would be immensely grateful to anyone that could help me out. At the root of it, I just want to know how to pass my GSocketConnection*
object to another class and use it without segfaulting.
Thank you.