Skip to content
Snippets Groups Projects
Commit 3bc10fb9 authored by Marc Mutz's avatar Marc Mutz
Browse files

QEvdev: Replace manual memory management with unique_ptr


Make create() return, and m_mice/m_keyboards/etc store, handlers by unique_ptr.
In most cases, we can't use qt_make_unique(), since the ctor we're calling is
marked as private.

Since QHash can't hold move-only types, use a std::vector<{QString, unique_ptr}>
instead. As this pattern repeats in all four QEvdev*Manager classes, create a
small class template.

Saves almost 6KiB on optimized Linux AMD64 GCC 9.1 builds across all .so's that
link to QtInputSupport.a.

Change-Id: I8f62b6b629d6e1855314c0a4fb4fc069db9ae0ce
Reviewed-by: default avatarAllan Sandfeld Jensen <allan.jensen@qt.io>
 
 
 
 
 
 
 
 
 
 
 
parent 12938ba7
Branches
Tags
No related merge requests found
Showing
with 145 additions and 58 deletions
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