From 1986375ad6a114fe57bf7863c49021dc21534cf5 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 13 Jun 2011 17:15:54 +0300 Subject: [PATCH] Minor change to EventReader to avoid an invalid handle error on windows --- source/io/eventreader.cpp | 5 ++--- source/io/eventreader.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/source/io/eventreader.cpp b/source/io/eventreader.cpp index a31a384..370ddf2 100644 --- a/source/io/eventreader.cpp +++ b/source/io/eventreader.cpp @@ -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; diff --git a/source/io/eventreader.h b/source/io/eventreader.h index b3acdb9..01c3721 100644 --- a/source/io/eventreader.h +++ b/source/io/eventreader.h @@ -30,7 +30,7 @@ public: EventReader(Handle &, unsigned); ~EventReader(); - const Handle &get_event() const; + const Handle &get_event(); void start(); void wait(); -- 2.45.2