make sure that mapView is initialized before referencing into it

This commit is contained in:
Konstantin Käfer
2014-02-17 17:55:47 +01:00
parent 9d89bc0909
commit 9fb05741d6
3 changed files with 5 additions and 4 deletions

View File

@@ -68,4 +68,4 @@ distclean:
test: all
echo test
.PHONY: test
.PHONY: test linux

View File

@@ -207,13 +207,15 @@ public:
llmr::Map map;
};
MapView *mapView;
MapView *mapView = nullptr;
namespace llmr {
namespace platform {
void restart(void *) {
mapView->dirty = true;
if (mapView) {
mapView->dirty = true;
}
}

View File

@@ -121,7 +121,6 @@ void warningHandler(png_structp png, png_const_charp error_msg) {
}
void Sprite::loadImage(const std::string& data) {
return;
std::lock_guard<std::mutex> lock(mtx);
Buffer buffer(data);