forked from thestinger/termite
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Use std::make_unique from c++14 thestinger#360"
This reverts commit 8dd8f55. The make_unique function in util/memory.hh is not at all like std::make_unique. The former is just a plain wrapper for the unique_ptr constructor and makes the resulting unique_ptr take ownership of the instance identified by the given pointer. std::make_unique on the otherhand allocates a new instance of a given type and makes creates a unique_ptr that has ownership of that instance. So what the patch did was to allocate a char pointer, that did not point at the string we're interested in, but instead points at the pointer that points to that string. This means that the string that was meant to be freed by the unique_ptr upon leaving its scope leaks. Additionally, the check in open_selection() wasn't adapted to handle the extra layer of indirection added by this change, so it always assumed that there was some selection, and tried to open it, completely breaking mouse usage.
- Loading branch information
Björn Steinbrink
committed
Feb 12, 2018
1 parent
a4af9e7
commit 9aaf970
Showing
2 changed files
with
15 additions
and
14 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