diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-03-09 17:56:32 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-03-09 12:11:01 -0700 |
commit | 2fcd4fff0a44340c1d22857373d2e88cf6641160 (patch) | |
tree | 5b4c4afa0c15a7545356ca35e0fa635e5899f854 /mobile-widgets/qmlmanager.h | |
parent | b15b9c6cd0e8d83ec12a868c10cf184217f51309 (diff) | |
download | subsurface-2fcd4fff0a44340c1d22857373d2e88cf6641160.tar.gz |
cleanup: fix NOCLOUD_LOCALSTORAGE leak
The macro NOCLOUD_LOCALSTORAGE creates the path to the local git
repository as a C-string. None of the users were freeing the string
and thus leaking memory.
Replace the macro by an inline function that creates a QString
and pass down to C-functions using the qPrintable() macro.
Note that every qPrintable() invocation does a UTF16->UTF8
conversion. This could be avoided by either using a std::string
or a QByteArray. However, we are talking about microseconds of
CPU time in operations that typically take seconds. Not worth
it.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'mobile-widgets/qmlmanager.h')
-rw-r--r-- | mobile-widgets/qmlmanager.h | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h index 145a3df17..74addbc50 100644 --- a/mobile-widgets/qmlmanager.h +++ b/mobile-widgets/qmlmanager.h @@ -19,8 +19,6 @@ #include "core/settings/qPrefCloudStorage.h" #include "core/subsurface-qt/divelistnotifier.h" -#define NOCLOUD_LOCALSTORAGE format_string("%s/cloudstorage/localrepo[master]", system_default_directory()) - class QMLManager : public QObject { Q_OBJECT Q_PROPERTY(QString logText READ logText WRITE setLogText NOTIFY logTextChanged) |