hopefully fixed the crash on exit, keep sectors script bundled in the sector and...
[supertux.git] / src / object / floating_image.cpp
index 1933b9b..b8fb087 100644 (file)
 #include "floating_image.hpp"
 
 FloatingImage::FloatingImage(const std::string& spritefile) 
-  : sprite(NULL), layer(LAYER_FOREGROUND1 + 1), visible(false),
-    anchor(ANCHOR_MIDDLE)
+  : layer(LAYER_FOREGROUND1 + 1), visible(false), anchor(ANCHOR_MIDDLE)
 {
-  sprite = sprite_manager->create(spritefile);
+  sprite.reset(sprite_manager->create(spritefile));
 }
 
 FloatingImage::~FloatingImage()
 {
-  delete sprite;
 }
 
 void