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 660524 - missing transfer declaration in peas-engine.c
missing transfer declaration in peas-engine.c
Status: RESOLVED FIXED
Product: libpeas
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: libpeas-maint
libpeas-maint
Depends on:
Blocks:
 
 
Reported: 2011-09-29 22:01 UTC by august
Modified: 2011-10-05 20:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Annotate PeasPluginInfo return values as transfer none (2.20 KB, patch)
2011-09-29 22:50 UTC, Garrett Regier
committed Details | Review

Description august 2011-09-29 22:01:39 UTC
The returned plugin_info from peas_engine_get_plugin_info () is unowned.

The declaration for introspection on peas_engine_get_plugin_info should say:

/**
 * peas_engine_get_plugin_info:
 * @engine: A #PeasEngine.
 * @plugin_name: A plugin name.
 *
 * Gets the #PeasPluginInfo corresponding with @plugin_name,
 * or %NULL if @plugin_name was not found.
 *
 * Returns: (transfer none): the #PeasPluginInfo corresponding with
 * a given plugin module name.
 */

right now it says:
/**
 * peas_engine_get_plugin_info:
 * @engine: A #PeasEngine.
 * @plugin_name: A plugin name.
 *
 * Gets the #PeasPluginInfo corresponding with @plugin_name,
 * or %NULL if @plugin_name was not found.
 *
 * Returns: the #PeasPluginInfo corresponding with
 * a given plugin module name.
 */

Without the "(transfer none)", GI assumes it is transfer full, afaik.  This can cause crashes.

Perhaps there are other places in the code where this is relevant.
Comment 1 Garrett Regier 2011-09-29 22:50:58 UTC
Created attachment 197829 [details] [review]
Annotate PeasPluginInfo return values as transfer none

Otherwise GObject-Introspection says that it is transfer full.
Comment 2 Steve Frécinaux 2011-10-05 20:12:38 UTC
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.