hey,
i want to use the MessageBox class in a c++ project but i get every time an Error !!
the error is at:
void RefCounted::ReleaseRef()
{
assert(refCount_->refs_ > 0);
(refCount_->refs_)--;
if (!refCount_->refs_)
delete this;
}
refCount is zero … but i dont know what i did wrong!
i am using as a quit message:
void SimpleSnake::Quit()
{
GetSubsystem<UI>()->GetCursor()->SetVisible(true);
messageBox_ = new Urho3D::MessageBox(context_, "Do you really want to exit the Game ?", "Quit Game ?");
if (messageBox_->GetWindow() != NULL)
{
Button* cancelButton = (Button*)messageBox_->GetWindow()->GetChild("CancelButton", true);
cancelButton->SetVisible(true);
cancelButton->SetFocus(true);
SubscribeToEvent(messageBox_, E_MESSAGEACK, HANDLER(SimpleSnake, HandleQuitMessageAck));
}
}
void SimpleSnake::HandleQuitMessageAck(StringHash eventType, VariantMap& eventData)
{
using namespace MessageACK;
bool ok_ = eventData[P_OK].GetBool();
GetSubsystem<UI>()->GetCursor()->SetVisible(false);
if (ok_)
{
engine_->Exit();
}
}