A event error

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

PeakGao
Just popping in
Just popping in
Posts: 9
Joined: Fri Apr 21, 2006 07:04

A event error

Postby PeakGao » Thu Apr 27, 2006 03:39

Hi,
I find a error in System class about event. in the System::constructor_impl:

Code: Select all

d_renderer->subscribeEvent(Renderer::EventDisplaySizeChanged, Event::Subscriber(&CEGUI::System::handleDisplaySizeChange, this));


when i do the code below:

Code: Select all

Renderer* myRenderer = new OpenGLRenderer;
new System(myRenderer,...,"login.config")
// ...
delete System::getSingetonPtr();
new System(myRenderer,...,"actorSelect.config");


so, Renderer has connected two subscriber, one subscriber come from the System class that had been deleted. anothor come from the last System class. When window size changed, a exception will raise!

so, in the System::~System(), should cancel the subscriber, it is a pity that EventSet does not support unsubscribe method. Event support unsubscibe method, but EventSet doesn't support getEvent(String) method (suggest that add getEvent method).

now, i only can do it by

Code: Select all

Renderer* myRenderer = new OpenGLRenderer;
new System(myRenderer,...,"login.config")
// ...
delete System::getSingetonPtr();

myRenderer->removeEvent(Renderer::EventDisplaySizeChanged);
myRenderer->addEvent(Renderer::EventDisplaySizeChanged);

new System(myRenderer,...,"actorSelect.config");


User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Postby lindquist » Thu Apr 27, 2006 14:57

Thanx again for the bug report :)
You are proving quite the valuable tester.

I'll add a ticket for now, and hopefully by the weekend I should be able to fix this.

Thanx

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Postby lindquist » Tue May 09, 2006 22:13

This is now fixed for both 0.4 and 0.5


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 9 guests