Jump to content

[SOLVED] Error message removing ObjectGui from scene


photo

Recommended Posts

Posted

Error message removing ObjectGui from scene.

  • Open demo Objects/gui_06.
  • Load unigine editor.
  • Select any ObjectGui.
  • Delete the selected ObjectGui.

"Gui::~Gui(): 1 widgets is not removed from GUI" message appears.

 

Thanks in advance,

 

      David García

    

Posted

Hello,

There are some widgets related to each ObjectGui (WidgetLabel in object/gui_06). So, all related widgets should be removed before ObjectGUI deleting to avoid errors.

 

You can't get access to the widgets from editor, but it can be taken into account in source code.

 

Thanks!

Posted

Hello,

 

    Why  ObjectGui desctructor doesn´t remove these widgets that belongs to its Gui object?

 

Thanks!

Posted

Deleted widgets can cause a crush because script system will have pointers on them. Moreover script handle manually constructed widgets automatically.

Posted

Hi frustum,

 

    Apologizes, but can you explain me "Moreover script handle manually constructed widgets automatically."? 

Posted

For example:

Gui gui = engine.getGui();
WidgetLabel label = new WidgetLabel(gui,"Label");
gui.addChild(label,GUI_ALIGN_OVERLAP);

You shouldn't have to delete label manually.

Because the label will be deleted automatically on world quit.

This code is working well for external Gui object.

But for ObjectGui you have to delete label before ObjectGui deletion.

 

×
×
  • Create New...