Jump to content

[SOLVED] Console spamming errors 2nd time opening two nested dialogs using UI files


photo

Recommended Posts

Main window has button that spawns permanent-focus DialogOne. DialogOne has button that spawns permanent-focus DialogTwo. DialogOne is always populated using UI file. DialogTwo is populated either using UI file or programmatically in UnigineScript, depending on if SHOW_BAD_BEHAVIOR is defined. If defined, it uses UI file. If not, it uses programmatic population. When DialogTwo uses UI file, opening it for the second time causes endless console errors.

 

Reproduction steps:

------

Load the attached world

Click button to open DialogOne

Click button in DialogOne to open DialogTwo

Close DialogTwo

Close DialogOne

Click button to open DialogOne

Click button in DialogOne to open DialogTwo

Endless console spam!?
 
Optionally, edit test.cpp, comment out #define SHOW_BAD_BEHAVIOR, reload world, problem is not reproducible without 2nd dialog using UI file.
 
What is going on here?

test.zip

Link to comment

Hi Adam,

 

This is also not a bug, you forgot to delete widget when you no longer need it (if you call new, don't forget to call delete!). Just add

delete d;

at the end of OpenDialogOne() and OpenDialogTwo() functions and you will not get any script crashes.

 

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

I see. I had a misunderstanding about how UnigineScript does memory management. I will re-read docs.

 

I am still confused and curious as to why this problem happens only when using a UserInterface.

Link to comment
×
×
  • Create New...