vcpkg/ports/co/fix-event-destruct.patch
Alvin f1e18c43d7
Add a patch for co v2.0.2 (#20657)
* add a patch for co v2.0.2

* update port version

* update version

* version

Co-authored-by: JackBoosY <yuzaiyang@beyondsoft.com>
2021-10-13 14:41:13 -07:00

14 lines
398 B
Diff

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);