summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2014-03-02 08:58:51 +0000
committerChris Wilson <chris+github@qwirx.com>2014-03-02 08:58:51 +0000
commit1fa34cd0b80e90e9cfb493fd2f085310279ad4f9 (patch)
tree6a9f287f8a8f00e5da772d53dcc815f89dc20c82 /lib
parent772ecab2a053fefbf7b65e66e05babfb21920aea (diff)
Fix memory leak in local protocol.
When a command fails with an error, and CheckReply throws an exception, the mStreamsToSend were not deleted.
Diffstat (limited to 'lib')
-rwxr-xr-xlib/server/makeprotocol.pl.in6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/server/makeprotocol.pl.in b/lib/server/makeprotocol.pl.in
index 97b0b3d9..f90b5474 100755
--- a/lib/server/makeprotocol.pl.in
+++ b/lib/server/makeprotocol.pl.in
@@ -604,7 +604,11 @@ print CPP <<__E;
}
$replyable_base_class\::~$replyable_base_class()
-{ }
+{
+ // If there were any streams left over, there's no longer any way to
+ // access them, and we're responsible for them, so we'd better delete them.
+ DeleteStreamsToSend();
+}
void $replyable_base_class\::SendStreamAfterCommand(std::auto_ptr<IOStream> apStream)
{