summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2011-10-14 21:55:56 -0700
committerPixel <pixel@nobis-crew.org>2011-10-14 21:55:56 -0700
commit953a4572e09a05dab4487b75eeb1f267b9e22c3a (patch)
tree5560bb6542d556777b54d590cb355d95a09cbb27 /includes
parentae657c4c8358b66d1ef867b8f90b1eaebaaa71ea (diff)
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.
Diffstat (limited to 'includes')
-rw-r--r--includes/Handle.h6
1 files changed, 4 insertions, 2 deletions
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: