From 953a4572e09a05dab4487b75eeb1f267b9e22c3a Mon Sep 17 00:00:00 2001 From: Pixel Date: Fri, 14 Oct 2011 21:55:56 -0700 Subject: Fixing a few bugs. -) The IO class needed an assignment operator, as well as the ability to NOT contain a Handle. -) The Task Manager wasn't properly starting up pending tasks that got added during startup. --- includes/Handle.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'includes') diff --git a/includes/Handle.h b/includes/Handle.h index 3339699..9f1486a 100644 --- a/includes/Handle.h +++ b/includes/Handle.h @@ -42,10 +42,12 @@ class Handle { class IO { public: + IO() : m_h(NULL) { } IO(Handle * h) { setHandle(h); } - ~IO() { m_h->delRef(); } + ~IO() { if (m_h) m_h->delRef(); } IO(const IO & io) { setHandle(io.m_h); } - Handle * operator->() { return m_h; } + IO & operator=(const IO & io) { if (m_h) m_h->delRef(); setHandle(io.m_h); return *this; } + Handle * operator->() { Assert(m_h); return m_h; } protected: void setHandle(Handle * h) { m_h = h; m_h->addRef(); } private: -- cgit v1.2.3