Ensure that the debug call won't crash if create_cstr_from_cfstring
returns NULL, fix the leak of that CFArrayRef, and make explicit the
failure condition of LSFindApplicationForInfo.
https://bugzilla.gnome.org/show_bug.cgi?id=788936
During testing with gdk-pixbuf I noticed failures during content type
to mime conversion. The root reason was the unsafe conversion used
in create_cstr_from_cfstring. The problem was addressed in commit
c60226e0a1 but that was reverted. I noticed the commit only
when I had fixed the problem. In addition I added a test to check
the content type to mime conversion on MacOS. This problem is
discussed in Bug #788936.
See: https://bugzilla.gnome.org/show_bug.cgi?id=788936
This reverts commit c60226e0a1.
Pushed without review. This should be reviewed on bug #788936 first.
Several issues with the patch:
• Takes the string length unnecessarily early.
• Calls CFRelease(str) before g_strdup(cstr) which could lead to
use-after-free.
• Code style issues.
• Don’t want to encourage pushing patches without review.
This is an implementation of most of GAppInfo using the OS X
NSBundle APIs.
Missing at this point are things that don't have equivalents
in OS X, such as hidden desktop files, last-used, manual type
associations, and g_app_info_get_all().
https://bugzilla.gnome.org/show_bug.cgi?id=734946