fix bug in Channel destructor for objects that were already moved
This commit is contained in:
parent
f3ba779e67
commit
599764ebb8
|
|
@ -22,7 +22,7 @@ class Channel
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
* The implementation for the channel
|
* The implementation for the channel
|
||||||
* @var std::unique_ptr<ChannelImpl>
|
* @var std::shared_ptr<ChannelImpl>
|
||||||
*/
|
*/
|
||||||
std::shared_ptr<ChannelImpl> _implementation;
|
std::shared_ptr<ChannelImpl> _implementation;
|
||||||
|
|
||||||
|
|
@ -58,7 +58,8 @@ public:
|
||||||
virtual ~Channel()
|
virtual ~Channel()
|
||||||
{
|
{
|
||||||
// close the channel (this will eventually destruct the channel)
|
// close the channel (this will eventually destruct the channel)
|
||||||
_implementation->close();
|
// note that the channel may be in an invalid state in case it was moved, hence the "if"
|
||||||
|
if (_implementation) _implementation->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue