-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Commit d1f50af broke the listener<> template in a subtle way: the destructor wouldn't remove listeners from the set because dynamic_cast to a derived type returns nullptr in a destructor. This caused a segfault upon saving map images. In order to solve both the warning that lead to the commit and the new bug, change the set of instances to hold listener<A>* instead of A*, and use dynamic_cast in invoke since the A objects are still valid there. While I was there, I changed invoke() to be a variadic template. It wasn't one because the code originally had to support C++03.
- Loading branch information
Showing
2 changed files
with
15 additions
and
64 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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