From 9c94fce02ff5858bbe4588cc0af81deb262dc5ac Mon Sep 17 00:00:00 2001 From: Paul Merrill Date: Sun, 3 Jul 2011 05:35:34 -0700 Subject: [PATCH] resourcer.cpp: fix big audio memory leak --- src/resourcer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/resourcer.cpp b/src/resourcer.cpp index 35ce641..7daa38f 100644 --- a/src/resourcer.cpp +++ b/src/resourcer.cpp @@ -152,8 +152,8 @@ xmlDoc* Resourcer::getXMLDoc(const std::string& name) */ Gosu::Sample* Resourcer::getSample(const std::string& name) { - Gosu::Buffer* buffer = read(name); - if (!buffer) + boost::scoped_ptr buffer(read(name)); + if (!buffer.get()) return NULL; return new Gosu::Sample(buffer->frontReader()); } -- 2.11.4.GIT