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 742391 - applications, userguides: Don't detect locale changes if we failed to create the miner
applications, userguides: Don't detect locale changes if we failed to create ...
Status: RESOLVED FIXED
Product: tracker
Classification: Core
Component: Miners
1.3.x
Other All
: Normal normal
: ---
Assigned To: tracker-general
Depends on:
Blocks:
 
 
Reported: 2015-01-05 15:55 UTC by Debarshi Ray
Modified: 2015-01-06 12:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
miners: Detect locale changes only when the miner could be constructed (21.86 KB, patch)
2015-01-05 15:59 UTC, Debarshi Ray
committed Details | Review

Description Debarshi Ray 2015-01-05 15:55:28 UTC
If construction of the miner object failed then g_initable_new returns NULL. Calling detect_locale_changed with NULL  will lead to a crash. See https://bugzilla.redhat.com/show_bug.cgi?id=1178483 and  https://bugzilla.redhat.com/show_bug.cgi?id=1178485
Comment 1 Debarshi Ray 2015-01-05 15:59:22 UTC
Created attachment 293836 [details] [review]
miners: Detect locale changes only when the miner could be constructed
Comment 2 Sam Thursfield 2015-01-06 12:07:08 UTC
Review of attachment 293836 [details] [review]:

Seems obviously correct to me: moving detect_locale_changed() inside the initable_init() callback so it only gets called on success (plus code rearrangement to avoid needing to declare detect_locale_changed() and miner_applications_reset() in advance)
Comment 3 Debarshi Ray 2015-01-06 12:49:45 UTC
Comment on attachment 293836 [details] [review]
miners: Detect locale changes only when the miner could be constructed

Thanks for the review, Sam.