]> git.tdb.fi Git - libs/core.git/commitdiff
Minor change to EventReader to avoid an invalid handle error on windows
authorMikko Rasa <tdb@tdb.fi>
Mon, 13 Jun 2011 14:15:54 +0000 (17:15 +0300)
committerMikko Rasa <tdb@tdb.fi>
Mon, 13 Jun 2011 14:15:54 +0000 (17:15 +0300)
source/io/eventreader.cpp
source/io/eventreader.h

index a31a384f7bd3156a1fbd51028779e1ae81b5b8b2..370ddf22124c8df52af420bb2958d04f50656c5d 100644 (file)
@@ -37,8 +37,6 @@ EventReader::EventReader(Handle &h, unsigned size):
        priv->buffer = new char[priv->buf_size];
        priv->buf_avail = 0;
        priv->buf_next = priv->buffer;
-
-       start();
 #else
        (void)size;
 #endif
@@ -54,9 +52,10 @@ EventReader::~EventReader()
        delete priv;
 }
 
-const Handle &EventReader::get_event() const
+const Handle &EventReader::get_event()
 {
 #ifdef WIN32
+       start();
        return priv->event;
 #else
        return handle;
index b3acdb9185d66a53d81181ca2f6fa28bb7874d9f..01c3721e895a17e728b89500fd36e8a6bd3e1aa0 100644 (file)
@@ -30,7 +30,7 @@ public:
        EventReader(Handle &, unsigned);
        ~EventReader();
 
-       const Handle &get_event() const;
+       const Handle &get_event();
 
        void start();
        void wait();