mirror of
https://github.com/Oibaf66/frodo-wii.git
synced 2024-11-13 07:05:12 +01:00
Make a copy of the passed argument (will otherwise give undef references)
This commit is contained in:
parent
63b7d45688
commit
4c9590e65d
@ -1,5 +1,6 @@
|
|||||||
#include "status_bar.hh"
|
#include "status_bar.hh"
|
||||||
#include "gui.hh"
|
#include "gui.hh"
|
||||||
|
#include "utils.hh"
|
||||||
|
|
||||||
StatusBar::StatusBar() : Menu(Gui::gui->small_font), TimeoutHandler()
|
StatusBar::StatusBar() : Menu(Gui::gui->small_font), TimeoutHandler()
|
||||||
{
|
{
|
||||||
@ -12,7 +13,7 @@ StatusBar::StatusBar() : Menu(Gui::gui->small_font), TimeoutHandler()
|
|||||||
|
|
||||||
void StatusBar::queueMessage(const char *message)
|
void StatusBar::queueMessage(const char *message)
|
||||||
{
|
{
|
||||||
this->messages[this->head] = message;
|
this->messages[this->head] = xstrdup(message);
|
||||||
|
|
||||||
/* If this is the first message, display it as soon as possible */
|
/* If this is the first message, display it as soon as possible */
|
||||||
if (this->head == this->tail)
|
if (this->head == this->tail)
|
||||||
@ -49,6 +50,7 @@ void StatusBar::timeoutCallback()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
this->setText(NULL);
|
this->setText(NULL);
|
||||||
|
free((void *)this->cur_message);
|
||||||
}
|
}
|
||||||
|
|
||||||
void StatusBar::draw(SDL_Surface *where)
|
void StatusBar::draw(SDL_Surface *where)
|
||||||
|
Loading…
Reference in New Issue
Block a user