After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 779467 - Improvements in application inialization
Improvements in application inialization
Status: RESOLVED FIXED
Product: bijiben
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Bijiben maintainer(s)
Bijiben maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2017-03-02 11:54 UTC by Iñigo Martínez
Modified: 2017-03-05 21:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fixed two possible memory leaks (3.51 KB, patch)
2017-03-02 11:56 UTC, Iñigo Martínez
committed Details | Review
Improved how files opening is handled (8.85 KB, patch)
2017-03-02 11:57 UTC, Iñigo Martínez
committed Details | Review

Description Iñigo Martínez 2017-03-02 11:54:22 UTC
There are two corner cases in the bijiben_application_local_command_line function where two memory leaks may happen.

In the other hand, some improvements may be possible to application initialization as note paths arguments are converted back and forth to GFiles.
Comment 1 Iñigo Martínez 2017-03-02 11:56:08 UTC
Created attachment 347052 [details] [review]
fixed two possible memory leaks

When executing bijiben_application_local_command_line function, if the remaining variable contains data, it is not freed if the code jumps to the out label.

Also if there is no remaining data, files will remain with NULL. In that case there is an allocation that is not freed as the code jumps to the out label.
Comment 2 Iñigo Martínez 2017-03-02 11:57:27 UTC
Created attachment 347053 [details] [review]
Improved how files opening is handled

This patch is a follow up of the last pach where two memory leaks were fixed.

On one hand file paths were converted back and forth to GFiles, on the other hand paths were removed and added to the files_to_open queue.

The code has been refactorized to avoid this and the files_to_open has been changed to a static variable to avoid a memory allocation.
Comment 3 Pierre-Yves Luyten 2017-03-05 21:41:09 UTC
Review of attachment 347052 [details] [review]:

commit 0c5e079ca1a3c323c6d1c99603ff06f10c535fed
Author: Iñigo Martínez <inigomartinez@gmail.com>
Date:   Sun Mar 5 22:32:52 2017 +0100

    bjb-bijiben: fixed two memory leaks
Comment 4 Pierre-Yves Luyten 2017-03-05 21:41:43 UTC
Review of attachment 347053 [details] [review]:

commit 39281eaac3a095ba3c7aa45631cfb10aa578a8a6
Author: Iñigo Martínez <inigomartinez@gmail.com>
Date:   Sun Mar 5 22:37:53 2017 +0100

    bjb-bijiben: improved how files opening is handled