Commits

Bart van Strien committed 0f6da4e

Channels, now with less memory leaks!

Comments (0)

Files changed (1)

src/modules/thread/Channel.cpp

 
 	Channel::~Channel()
 	{
+		while (!queue.empty())
+		{
+			queue.front()->release();
+			queue.pop();
+		}
+
 		delete mutex;
 		delete cond;
 		if (named)
 	{
 		Lock l(mutex);
 		while (!queue.empty())
+		{
+			queue.front()->release();
 			queue.pop();
+		}
 
 		// Once again, release our own
 		// reference if we're named.