summaryrefslogtreecommitdiff
path: root/lib/engine.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/engine.cc')
-rw-r--r--lib/engine.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/engine.cc b/lib/engine.cc
index bcf5dc0..84014c7 100644
--- a/lib/engine.cc
+++ b/lib/engine.cc
@@ -26,7 +26,6 @@ int mogltk::engine::GetInited() {
class embedRWops : public Base {
public:
embedRWops(Handle *);
- ~embedRWops();
int seek(int, int);
int read(void *, int, int);
int write(const void *, int, int);
@@ -34,11 +33,7 @@ class embedRWops : public Base {
Handle * h;
};
-embedRWops::embedRWops(Handle * ah) : h(new Handle(*ah)) {}
-
-embedRWops::~embedRWops() {
- delete h;
-}
+embedRWops::embedRWops(Handle * ah) : h(ah) {}
int embedRWops::seek(int offset, int whence) {
return h->seek(offset, whence);
@@ -73,6 +68,7 @@ static int embedRWwrite(SDL_RWops * context, const void * ptr, int size, int num
static int embedRWclose(SDL_RWops * context) {
if (context->hidden.unknown.data1) {
delete ((embedRWops *)(context->hidden.unknown.data1));
+ context->hidden.unknown.data1 = 0;
return 0;
}
return -1;