diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-03-24 21:50:01 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-03-24 21:57:13 -0700 |
commit | 04593e8ec4bac2606dec54605c72a6a49cc83f9b (patch) | |
tree | 030da73608ad9bf1653b5018404b3a5514e6c7bd /core/qthelper.h | |
parent | 8facd937f86d913d94275abb80bfa4d2b181bbc6 (diff) | |
download | subsurface-04593e8ec4bac2606dec54605c72a6a49cc83f9b.tar.gz |
Cleanup: fix printGPSCoords signature and leaks
The printGPSCoords() function returns a copied C-style string. Since
the owndership is transferred to the caller, the correct return type
is "char *" instead of "const char *".
Thus a number of casts when calling free can be removed.
Moreover a number of callers didn't free the string and thus were
leaking memory. Fix them. Ultimately we might want two versions
of the function: one for QString, one for C-style strings.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/qthelper.h')
-rw-r--r-- | core/qthelper.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/qthelper.h b/core/qthelper.h index 3e90a1979..ed09d70fb 100644 --- a/core/qthelper.h +++ b/core/qthelper.h @@ -123,7 +123,7 @@ void moveInVector(Vector &v, int rangeBegin, int rangeEnd, int destination) extern "C" { #endif -const char *printGPSCoords(const location_t *loc); +char *printGPSCoords(const location_t *loc); bool in_planner(); bool getProxyString(char **buffer); bool canReachCloudServer(); |