allow providing a callback to uv_messenger_stop to prevent mismatched new/free

This commit is contained in:
Konstantin Käfer
2014-10-30 17:46:57 -04:00
parent 1955600904
commit 80366bc615
4 changed files with 17 additions and 7 deletions

View File

@@ -23,9 +23,9 @@ FileSource::FileSource(uv_loop_t *loop_, const std::string &path)
FileSource::~FileSource() {
assert(thread_id == uv_thread_self());
uv_messenger_stop(queue);
// NOTE: We don't need to delete the messenger since it will be deleted by the
// uv_messenger_stop() function.
uv_messenger_stop(queue, [](uv_messenger_t *msgr) {
delete msgr;
});
util::ptr<BaseRequest> req;