diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2019-02-05 22:03:38 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2019-02-05 22:03:38 (GMT) |
commit | 17f591f2230ac66394467d5e5eefe71cb259637d (patch) | |
tree | 1664e994b2904e5e9009027fc57749a11667365b /src/glibext | |
parent | ff187d24b7441e88e1f0361d59b0f6f55851791f (diff) |
Fixed a huge number of memory leaks.
Diffstat (limited to 'src/glibext')
-rw-r--r-- | src/glibext/gbinportion.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/glibext/gbinportion.c b/src/glibext/gbinportion.c index e020506..0074713 100644 --- a/src/glibext/gbinportion.c +++ b/src/glibext/gbinportion.c @@ -202,6 +202,11 @@ static void g_binary_portion_interface_init(GLineGeneratorInterface *iface) static void g_binary_portion_dispose(GBinPortion *portion) { + size_t i; /* Boucle de parcours */ + + for (i = 0; i < portion->count; i++) + g_clear_object(&portion->subs[i]); + G_OBJECT_CLASS(g_binary_portion_parent_class)->dispose(G_OBJECT(portion)); } @@ -238,6 +243,9 @@ static void g_binary_portion_finalize(GBinPortion *portion) if (portion->text != NULL) free(portion->text); + if (portion->subs != NULL) + free(portion->subs); + G_OBJECT_CLASS(g_binary_portion_parent_class)->finalize(G_OBJECT(portion)); } |