New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memleak in TorController [rework] #7637

Merged
merged 1 commit into from Mar 11, 2016

Conversation

Projects
None yet
5 participants
@laanwj
Member

laanwj commented Mar 3, 2016

It looks like, TorController::disconnected_cb(TorControlConnection& conn) gets called multiple times which results in multiple event_new().

Avoid this by creating the event only once in the constructore, and deleting it only once in the destructor (thanks to Cory Fields for the idea).

Replaces the fix by Jonas Schnelli in #7610, see discussion there.

Fix memleak in TorController [rework]
It looks like, TorController::disconnected_cb(TorControlConnection&
conn) gets called multiple times which results in multiple event_new().

Avoid this by creating the event only once in the constructore, and
deleting it only once in the destructor (thanks to Cory Fields for the
idea).

Replaces the fix by Jonas Schnelli in #7610, see discussion there.
@jonasschnelli

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Mar 3, 2016

Member

utACK.

Member

jonasschnelli commented Mar 3, 2016

utACK.

@theuni

This comment has been minimized.

Show comment
Hide comment
@theuni

theuni Mar 4, 2016

Member

ut ACK

Member

theuni commented Mar 4, 2016

ut ACK

@laanwj laanwj merged commit e219503 into bitcoin:master Mar 11, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

laanwj added a commit that referenced this pull request Mar 11, 2016

Merge #7637: Fix memleak in TorController [rework]
e219503 Fix memleak in TorController [rework] (Wladimir J. van der Laan)
@paveljanik

This comment has been minimized.

Show comment
Hide comment
@paveljanik

paveljanik Mar 11, 2016

This removal generated new warning:

torcontrol.cpp:365:24: warning: private field 'base' is not used [-Wunused-private-field]
    struct event_base* base;
                       ^
1 warning generated.

paveljanik commented on src/torcontrol.cpp in e219503 Mar 11, 2016

This removal generated new warning:

torcontrol.cpp:365:24: warning: private field 'base' is not used [-Wunused-private-field]
    struct event_base* base;
                       ^
1 warning generated.

MarcoFalke added a commit to MarcoFalke/bitcoin that referenced this pull request Apr 27, 2016

Fix memleak in TorController [rework]
It looks like, TorController::disconnected_cb(TorControlConnection&
conn) gets called multiple times which results in multiple event_new().

Avoid this by creating the event only once in the constructore, and
deleting it only once in the destructor (thanks to Cory Fields for the
idea).

Replaces the fix by Jonas Schnelli in #7610, see discussion there.

Github-Pull: #7637
Rebased-From: e219503
@MarcoFalke

This comment has been minimized.

Show comment
Hide comment
@MarcoFalke

MarcoFalke Jun 9, 2016

Member

Backported as part of #7938. Removing label 'Needs backport'.

Member

MarcoFalke commented Jun 9, 2016

Backported as part of #7938. Removing label 'Needs backport'.

zander added a commit to zander/bitcoinclassic that referenced this pull request Jun 16, 2016

Fix memleak in TorController [rework]
It looks like, TorController::disconnected_cb(TorControlConnection&
conn) gets called multiple times which results in multiple event_new().

Avoid this by creating the event only once in the constructore, and
deleting it only once in the destructor (thanks to Cory Fields for the
idea).

Replaces the fix by Jonas Schnelli in #7610, see discussion there.

Github-Pull: #7637
Rebased-From: e219503

thokon00 added a commit to faircoin/faircoin that referenced this pull request Jun 28, 2016

Fix memleak in TorController [rework]
It looks like, TorController::disconnected_cb(TorControlConnection&
conn) gets called multiple times which results in multiple event_new().

Avoid this by creating the event only once in the constructore, and
deleting it only once in the destructor (thanks to Cory Fields for the
idea).

Replaces the fix by Jonas Schnelli in #7610, see discussion there.

Github-Pull: #7637
Rebased-From: e219503
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment