Closed
Conversation
Member
|
utACK |
Member
|
Why free/create every time the event is set? They're reusable. Edit: The naming may be confusing to those unfamiliar with libevent. event_new allocates, event_add schedules a new event, event_del un-schedules if not yet run, event_free deallocates. I suggest just making it RAII-like. |
Member
|
Good point @theuni! |
laanwj
added a commit
to laanwj/bitcoin
that referenced
this pull request
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 bitcoin#7610, see discussion there.
Member
|
Closing in favor of #7637 |
Member
|
Removing label 'needs backport' |
maflcko
pushed a commit
to maflcko/bitcoin-core
that referenced
this pull request
Apr 27, 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 bitcoin#7610, see discussion there. Github-Pull: bitcoin#7637 Rebased-From: e219503
thokon00
pushed a commit
to faircoin/faircoin
that referenced
this pull request
Jun 28, 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 bitcoin#7610, see discussion there. Github-Pull: bitcoin#7637 Rebased-From: e219503
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It looks like,
TorController::disconnected_cb(TorControlConnection& conn)gets called multiple times which results in multipleevent_new().Needs testing!