Created
May 10, 2012 23:49
-
-
Save j0sh/2656634 to your computer and use it in GitHub Desktop.
Don't double-enqueue packets for delete.
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
| commit 0d6fe2f32bcece6ecacfabfc894846a9a3d2f262 | |
| Author: Josh Allmann <joshua.allmann@gmail.com> | |
| Date: Thu May 10 16:40:03 2012 -0700 | |
| -- Don't double-enqueue packets for delete. | |
| This may lead to an infinite loop in some cases, | |
| especially with dependent protocols that are not chained. | |
| diff --git a/sources/thelib/src/protocols/baseprotocol.cpp b/sources/thelib/src/protocols/baseprotocol.cpp | |
| index 3b08a48..2a2771d 100644 | |
| --- a/sources/thelib/src/protocols/baseprotocol.cpp | |
| +++ b/sources/thelib/src/protocols/baseprotocol.cpp | |
| @@ -199,6 +199,7 @@ BaseProtocol *BaseProtocol::GetNearEndpoint() { | |
| } | |
| void BaseProtocol::EnqueueForDelete() { | |
| + if (_enqueueForDelete) return; | |
| _enqueueForDelete = true; | |
| ProtocolManager::EnqueueForDelete(this); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment