Commit Graph

10 Commits

Author SHA1 Message Date
Aleksander Morgado
74fc5baca2 core: port GRegex/GMatchInfo to use autoptr()
The behavior of GRegex changed in 2.73.2 once it was ported from pcre1
to pcre2. In some cases it was made more strict, which is fine, in
other cases it exposed some change in how it behaves on certain
matches that is not extremely clear whether it's ok or not.

See https://gitlab.gnome.org/GNOME/glib/-/issues/2729
See https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/601
See https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/621

Either way, one thing that was assumed was that initializing all
GRegex/GMatchInfo variables to NULL and making sure they're NULL
before they're initialized by glib (especially the GMatchInfo) was a
good and safer approach.

So, whenever possible, g_autoptr() is used to cleanup the allocated
GMatchInfo/GRegex variables, and otherwise, g_clear_pointer() is used
to ensure that no free/unref is attempted unless the given variable is
not NULL, and also so that the variable is reseted to NULL after being
disposed.
2022-09-05 17:33:11 +00:00
Aleksander Morgado
21c775703c libmm-glib: fix license in sources
The libmm-glib library is LGPLv2+, not GPLv2+.
2021-11-16 17:54:26 +01:00
Aleksander Morgado
5dd829174f libmm-glib: flag as (skip) all non-API methods
So that the GI scanner ignores them.
2019-10-28 10:28:31 +01:00
Aleksander Morgado
08d23dd64d docs,libmm-glib: provide per-version indices 2019-10-28 10:28:31 +01:00
Ben Chan
749b806c30 core: remove unnecessary NULL checks for g_free()
g_free() already check if the given pointer is NULL and does nothing on
a NULL pointer.
2018-10-18 13:17:36 +02:00
Aleksander Morgado
fe05383fe5 libmm-glib,gps-raw: prefer $GNGGA over $GPGGA
The $GNGGA traces provide "combined" values when multiple satellite
constellations are used (e.g. GPS+GLONASS). Prefer these values over
the GPS-only $GPGGA traces if both are received.
2018-10-17 11:17:17 +02:00
Aleksander Morgado
066c9c1e40 libmm-glib,location-gps-raw: plug memleak
==8663== 1 bytes in 1 blocks are definitely lost in loss record 5 of 4,864
    ==8663==    at 0x4C2CEDF: malloc (vg_replace_malloc.c:299)
    ==8663==    by 0x669FAC9: g_malloc (in /usr/lib/libglib-2.0.so.0.5600.1)
    ==8663==    by 0x66B9AEA: g_strndup (in /usr/lib/libglib-2.0.so.0.5600.1)
    ==8663==    by 0x66ACE52: g_match_info_fetch (in /usr/lib/libglib-2.0.so.0.5600.1)
    ==8663==    by 0x4E96DD2: mm_location_gps_raw_add_trace (mm-location-gps-raw.c:208)
    ==8663==    by 0x18721E: mm_iface_modem_location_gps_update (mm-iface-modem-location.c:264)
    ==8663==    by 0x1B9C7F: loc_location_nmea_indication_cb (mm-shared-qmi.c:712)
    ==8663==    by 0x640C9E7: g_cclosure_marshal_VOID__BOXEDv (in /usr/lib/libgobject-2.0.so.0.5600.1)
    ==8663==    by 0x6409C95: ??? (in /usr/lib/libgobject-2.0.so.0.5600.1)
    ==8663==    by 0x64259E8: g_signal_emit_valist (in /usr/lib/libgobject-2.0.so.0.5600.1)
    ==8663==    by 0x642612F: g_signal_emit (in /usr/lib/libgobject-2.0.so.0.5600.1)
    ==8663==    by 0x54AAB2D: process_indication (qmi-loc.c:7454)

Reported by: Thomas Weißschuh <thomas@weissschuh.net>
2018-06-28 00:09:27 +02:00
Aleksander Morgado
72068598e5 libmm-glib: new header file for common stuff in location reporting 2012-11-02 08:23:10 +01:00
Aleksander Morgado
487090607d libmm-glib,location-gps-raw: improve documentation 2012-10-04 10:17:12 +02:00
Aleksander Morgado
b6d628b3a1 build: merge libmm-common into libmm-glib
It's pointless to have libmm-common around, just merge it into libmm-glib and
make ModemManager depend on libmm-glib directly. At the end, the non-common
stuff in libmm-glib is really minimal.
2012-10-04 10:17:05 +02:00