- memleak fix and menu fix from MatzeB
[supertux.git] / src / sprite_manager.cpp
index e0ac012..ca6da2f 100644 (file)
@@ -1,7 +1,7 @@
 //  $Id$
 //
-//  Pingus - A free Lemmings clone
-//  Copyright (C) 2002 Ingo Ruhnke <grumbel@gmx.de>
+//  SuperTux
+//  Copyright (C) 2004 Ingo Ruhnke <grumbel@gmx.de>
 //
 //  This program is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU General Public License
@@ -29,7 +29,8 @@ SpriteManager::SpriteManager(const std::string& filename)
 void
 SpriteManager::load_resfile(const std::string& filename)
 {
-  lisp_object_t* cur = lisp_read_from_file(filename);
+  lisp_object_t* root_obj = lisp_read_from_file(filename);
+  lisp_object_t* cur = root_obj;
 
   if (strcmp(lisp_symbol(lisp_car(cur)), "supertux-resources") != 0)
     return;
@@ -62,6 +63,8 @@ SpriteManager::load_resfile(const std::string& filename)
 
       cur = lisp_cdr(cur);
     }
+
+  lisp_free(root_obj);
 }
 
 Sprite*