Page 1 of 1

setDefaultTooltip bug?

Posted: Fri Jan 09, 2009 23:57
by Pompei2
Hello,
As you know I'm still using some old 0.0.5 or 0.0.6 trunk. I found a bug but did not find a mantis ticket that seems to have solved it, so I still post it here. Sorry if it's already solved.

when doing setDefaultTooltip(NULL), it crashes because of the following code:

Code: Select all

d_weOwnTooltip = false;
d_defaultTooltip = tooltip;
d_defaultTooltip->setWritingXMLAllowed(false);

The last line then crashes.
When setting the default tooltip to an empty string, it is handled correctly.

Edit: sorry this post should go into bugreports, don't know how I can move it, noticed it too late ...

Edit: More info, when I do this:

Code: Select all

        m_pDefToolTip = CEGUI::System::getSingleton().getDefaultTooltip();
        CEGUI::System::getSingleton().setDefaultTooltip("");
        CEGUI::System::getSingleton().setDefaultTooltip(m_pDefToolTip);

then the CEGUI system crashes while handling the next mouse move event. m_pDefToolTip is not null. Callstack:

Code: Select all

CEGUI::System::injectMousePosition
CEGUI::System::injectMouseMove
CEGUI::Window::onMouseEnters
CEGUI::Tooltip::setTargetWindow
CEGUI::Window::addChildWindow
??(at the line: addChild_impl)

window is NOT null.

I hope (for me) this bug is not yet fixed in the current trunk, as I could find no mantis ticket for it.

Posted: Sun Jan 11, 2009 22:18
by CrazyEddie
Hi,

The first issue is very obviously wrong, and has not yet been fixed, a ticket will be added shortly.

The second issue, where you take the address of the default tooltip may or may not be a bug, depending on what whether you originally created that tooltip window manually.

If you did not create that tooltip object yourself, then the behaviour is as you'd expect - because you're taking the address of an object, setting the tooltip type to "", which causes the object you have the address of to be deleted, then setting the tooltip back to the address of the deleted object. Cue fireworks ;)

CE.

Posted: Sun Jan 11, 2009 22:47
by Pompei2
CrazyEddie wrote:If you did not create that tooltip object yourself, then the behaviour is as you'd expect - because you're taking the address of an object, setting the tooltip type to "", which causes the object you have the address of to be deleted, then setting the tooltip back to the address of the deleted object. Cue fireworks ;)

damn, you're right I'm doing:

Code: Select all

CEGUI::System::getSingleton().setDefaultTooltip("ArkanaLook/Tooltip");

I had enough fireworks on new year's eve :) thanks once again. Shall I mark this as solved? (I ask because of the first one)

Posted: Mon Jan 12, 2009 21:34
by CrazyEddie
Pompei2 wrote:Shall I mark this as solved? (I ask because of the first one)

You could maybe put [part-solved] or something, though leaving it as-is is fine also :)

Posted: Tue Jan 13, 2009 11:57
by Pompei2
ok boss :P