Hi,
I’m working on Multi Windowed GTK3 application in C. I’m getting
received signal SIGSEGV, Segmentation fault 0x00007ffff7049d26 in g_slice_alloc ()
During restart of my application.
My application flow goes like this.
// IniT GTK
if (!gtk_init_check (nullptr, nullptr)) [[unlikely]]
return false;
// Create GTK Application
app = gtk_application_new ("world.tally", G_APPLICATION_FLAGS_NONE);
// Start Event loop
g_application_run (G_APPLICATION (TWGtkApplicationWrapper::GetGtkAppPtr ()), 0, nullptr);
// Create a invisible window just to keep the event loop running even if there are no visible window from the applicataion
sInvisibleWindow = gtk_application_window_new (sGtkApplicationPtr);
// Create visible window and its contents
...
...
With this we have our window and its interaction up and running. But when we restart we will close all the visible windows with
gtk_widget_destroy
we will keep our invisible window so that the event loop does not quit. And then we follow the same way as earlier to bring up the new window.
But after the window comes up after restart, when i interact on the window i get
Thread 1 “TWTallySCPNativ” received signal SIGSEGV, Segmentation fault.
0x00007ffff7049d26 in g_slice_alloc () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
This error comes in different point of time, it come if I Click on Window or sometime click outside window or immediately after the window is visible
Not able to pin point where the error is from. Below are the call stack of the errors which occurred in different point of time
I can understand something is wrong with the memory but not able to find what went wrong.
Need help in fixing this error