diff options
author | François Andriot <francois.andriot@free.fr> | 2014-09-07 00:51:53 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2014-09-07 00:51:53 +0200 |
commit | 9c2ce91a364c22f9b232eb40f3c2a392360ed21c (patch) | |
tree | fe4426256c61f548b5b3ac4c30a55b7541f996fa /src | |
parent | 6d4396b3b55acb110e6ac238bf346f581f621052 (diff) | |
download | tqt3-9c2ce91a364c22f9b232eb40f3c2a392360ed21c.tar.gz tqt3-9c2ce91a364c22f9b232eb40f3c2a392360ed21c.zip |
Fix FTBFS on Linux specific memlock code
Diffstat (limited to 'src')
-rw-r--r-- | src/tools/qstring.cpp | 6 | ||||
-rw-r--r-- | src/widgets/qlineedit.cpp | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/tools/qstring.cpp b/src/tools/qstring.cpp index 927669c61..67de50301 100644 --- a/src/tools/qstring.cpp +++ b/src/tools/qstring.cpp @@ -1075,9 +1075,11 @@ TQStringData::~TQStringData() { if ( unicode ) { delete[] ((char*)unicode); } +#if defined(Q_OS_LINUX) if ( ascii && security_unpaged ) { munlock(ascii, LINUX_MEMLOCK_LIMIT_BYTES); } +#endif if ( ascii ) { delete[] ascii; } @@ -5953,15 +5955,19 @@ const char* TQString::ascii() const void TQString::setSecurityUnPaged(bool lock) { if (lock != d->security_unpaged) { if (d->security_unpaged) { +#if defined(Q_OS_LINUX) if (d->ascii) { munlock(d->ascii, LINUX_MEMLOCK_LIMIT_BYTES); } +#endif d->security_unpaged = false; } else { +#if defined(Q_OS_LINUX) if (d->ascii) { mlock(d->ascii, LINUX_MEMLOCK_LIMIT_BYTES); } +#endif d->security_unpaged = true; } } diff --git a/src/widgets/qlineedit.cpp b/src/widgets/qlineedit.cpp index 2cc64e017..196e097ce 100644 --- a/src/widgets/qlineedit.cpp +++ b/src/widgets/qlineedit.cpp @@ -461,7 +461,9 @@ TQLineEdit::~TQLineEdit() { if ((d->echoMode == NoEcho) || (d->echoMode == Password) || (d->echoMode == PasswordThreeStars)) { d->text.fill(TQChar(0)); +#if defined(Q_OS_LINUX) munlock(d->text.d->unicode, LINUX_MEMLOCK_LIMIT_BYTES); +#endif } delete [] d->maskData; delete d; |