aboutsummaryrefslogtreecommitdiff
path: root/ports/co/fix-event-destruct.patch
blob: b5abc57e78c11612b6922f639b73a0b223024fc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/co/co.cc b/src/co/co.cc
index 8921296..838ac16 100644
--- a/src/co/co.cc
+++ b/src/co/co.cc
@@ -8,7 +8,7 @@ namespace co {
 class EventImpl {
   public:
     EventImpl() : _counter(0), _signaled(false), _has_cond(false) {}
-    ~EventImpl() { co::xx::cond_destroy(&_cond); }
+    ~EventImpl() { if (_has_cond) co::xx::cond_destroy(&_cond); }
 
     bool wait(uint32 ms);