Skip to content
Commit 9d56e73d authored by Fabian Kosmale's avatar Fabian Kosmale
Browse files

PlatformXcb.cpp: Use custom deleter for xcb types

Summary:
std::unique_ptr uses std::default_delete, which calls delete on the
pointer managed by the unique_ptr. However, the xcb types were not
allocated with new, but with free. Hence, tools like asan will report a
malloc/delete missmatch. This is generally not an issue in practice, but
can be annoying when debugging.

To remedy this, we use a custom deleter which simply uses free instead
of delete.

Test Plan:
Compile application with ASAN enabled. Note that after applying the patch, it does not
abort any longer due to the malloc/delete missmatch. Take a screenshot to verify that the program
is still working fine.

Reviewers: #spectacle, davidre

Reviewed By: #spectacle, davidre

Subscribers: davidre, #spectacle

Tags: #spectacle

Differential Revision: https://phabricator.kde.org/D23474
parents 301d8ef2 b1a56cdb
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment