Commit b0535224c67b0c1578c13fb6d31128aba6fd1f12
Fix leaking memory from XKeyboard::getGroupCount()
We shouldn't lose much by not updating list of layouts.
Alternatively, could rewrite initializeXkb(), but it's quite
heavyweight to call often, so just leave this stuff commented out.
There was also const_cast<>...
Author: xaizek
Author date (UTC): 2016-12-02 21:59
Committer name: xaizek
Committer date (UTC): 2016-12-02 22:02
Parent(s): 7b9620c3eb4931086344ebfccb2f9f3268d0c093
Signing key: 99DC5E4DB05F6BE2
Tree: c6c969169d056248b1fbca9c7b293895e3d6a3a5
File src/XKeyboard.cpp changed (mode: 100644) (index ff9295b..f214250) |
... |
... |
int XKeyboard::currentGroupNum() const |
252 |
252 |
|
|
253 |
253 |
std::size_t XKeyboard::getGroupCount() const |
std::size_t XKeyboard::getGroupCount() const |
254 |
254 |
{ |
{ |
255 |
|
static_cast<void>(const_cast<XKeyboard *>(this)->initializeXkb()); |
|
|
255 |
|
// this probably supposed to update list of layouts, but loading it every |
|
256 |
|
// time isn't nice and results in memory leak in _symbolNames (elements are |
|
257 |
|
// appended there) |
|
258 |
|
// static_cast<void>(const_cast<XKeyboard *>(this)->initializeXkb()); |
256 |
259 |
return static_cast<std::size_t>(_groupNames.size()); |
return static_cast<std::size_t>(_groupNames.size()); |
257 |
260 |
} |
} |
258 |
261 |
|
|