You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently trying to use GWork within a singleton class like the following:
class GuiManager {
public:
// NOTE: allegro *must* be initialized for these to work
static Gwk::Controls::Canvas* GetCanvas() {
return GetInst().gwk_canvas;
}
static Gwk::Input::Allegro* GetInput() {
return GetInst().gwk_input;
}
private:
static GuiManager& GetInst() {
static GuiManager gui_inst;
return gui_inst;
}
GuiManager() {
// this is why allegro must be initialized
ALLEGRO_DISPLAY* display = al_get_current_display();
Gwk::Platform::SetPlatformWindow(display);
gwk_renderer = new Gwk::Renderer::Allegro();
gwk_skin = new Gwk::Skin::TexturedBase(gwk_renderer);
gwk_skin->SetRender(gwk_renderer);
gwk_skin->Init("data/DefaultSkin.png");
gwk_skin->SetDefaultFont("data/OpenSans.ttf", 11);
gwk_canvas = new Gwk::Controls::Canvas(gwk_skin);
gwk_canvas->SetSize(al_get_display_width(display),
al_get_display_height(display));
gwk_canvas->SetDrawBackground(true);
gwk_canvas->SetBackgroundColor(Gwk::Color(94, 127, 181, 255));
gwk_input = new Gwk::Input::Allegro();
gwk_input->Initialize(gwk_canvas);
}
Gwk::Renderer::Allegro* gwk_renderer;
Gwk::Skin::TexturedBase* gwk_skin;
Gwk::Controls::Canvas* gwk_canvas;
Gwk::Input::Allegro* gwk_input;
};
This is causing an error on program termination: *** Error in./client': corrupted double-linked list: 0x000000000139cd40 ***`
I believe this is caused by the non-deterministic deletion order when the singleton members are destructed.
Is there a correct order to follow for manual deletion of these GWork instances?
Currently if I try to delete them I am getting a segfault.
Thanks in advance.
The text was updated successfully, but these errors were encountered:
This error has stopped happening after a complete clean and rebuild, but my question is still valid about the correct order for deleting GWork objects.
I am currently trying to use GWork within a singleton class like the following:
This is causing an error on program termination:
*** Error in
./client': corrupted double-linked list: 0x000000000139cd40 ***`I believe this is caused by the non-deterministic deletion order when the singleton members are destructed.
Is there a correct order to follow for manual deletion of these GWork instances?
Currently if I try to delete them I am getting a segfault.
Thanks in advance.
The text was updated successfully, but these errors were encountered: