mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-29 21:33:30 +02:00
fixed a bag full of subtle bugs of immensive screw-up potential in
Sun Nov 5 05:22:55 2000 Tim Janik <timj@gtk.org> * gsignal.c: fixed a bag full of subtle bugs of immensive screw-up potential in handlers_find(), luckily no one found out about them yet ;) fixed signal_handlers_foreach_matched_R() so it operates on an initial handler list snapshot provided by handlers_find() to work around general reentrancy problems and to avoid multiple callback() invocations on the same handlers. this code is now officially 80% bug free (10% remaining for interface types, and 10% remaining for destroyed signals ;) Sat Nov 4 02:01:33 2000 Tim Janik <timj@gtk.org> * gsignal.c (_g_signals_destroy): valid signal nodes start out at 1. * gtypeplugin.[hc]: new files holding a GTypePlugin interface implementation that provides the API required by GType to deal with dynamically loadable types. * gtype.[hc]: displace any GTypePlugin business to gtypeplugin.h.
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
#include "gtype.h"
|
||||
|
||||
#include "gtypeplugin.h"
|
||||
#include <string.h>
|
||||
|
||||
#define FIXME_DISABLE_PREALLOCATIONS
|
||||
@@ -45,10 +46,6 @@
|
||||
G_TYPE_FLAG_DEEP_DERIVABLE)
|
||||
#define TYPE_FLAG_MASK (G_TYPE_FLAG_ABSTRACT)
|
||||
|
||||
#define g_type_plugin_ref(p) ((p)->vtable->plugin_ref (p))
|
||||
#define g_type_plugin_unref(p) ((p)->vtable->plugin_unref (p))
|
||||
#define g_type_plugin_complete_type_info(p,t,i,v) ((p)->vtable->complete_type_info ((p), (t), (i), (v)))
|
||||
#define g_type_plugin_complete_interface_info(p,f,t,i) ((p)->vtable->complete_interface_info ((p), (f), (t), (i)))
|
||||
|
||||
|
||||
/* --- typedefs --- */
|
||||
@@ -398,31 +395,19 @@ check_plugin (GTypePlugin *plugin,
|
||||
type_name);
|
||||
return FALSE;
|
||||
}
|
||||
if (!plugin->vtable)
|
||||
if (!G_IS_TYPE_PLUGIN (plugin))
|
||||
{
|
||||
g_warning ("plugin for type `%s' has no function table",
|
||||
type_name);
|
||||
g_warning ("plugin pointer (%p) for type `%s' is invalid",
|
||||
plugin, type_name);
|
||||
return FALSE;
|
||||
}
|
||||
if (!plugin->vtable->plugin_ref)
|
||||
{
|
||||
g_warning ("plugin for type `%s' has no plugin_ref() implementation",
|
||||
type_name);
|
||||
return FALSE;
|
||||
}
|
||||
if (!plugin->vtable->plugin_unref)
|
||||
{
|
||||
g_warning ("plugin for type `%s' has no plugin_unref() implementation",
|
||||
type_name);
|
||||
return FALSE;
|
||||
}
|
||||
if (need_complete_type_info && !plugin->vtable->complete_type_info)
|
||||
if (need_complete_type_info && !G_TYPE_PLUGIN_GET_CLASS (plugin)->complete_type_info)
|
||||
{
|
||||
g_warning ("plugin for type `%s' has no complete_type_info() implementation",
|
||||
type_name);
|
||||
return FALSE;
|
||||
}
|
||||
if (need_complete_interface_info && !plugin->vtable->complete_interface_info)
|
||||
if (need_complete_interface_info && !G_TYPE_PLUGIN_GET_CLASS (plugin)->complete_interface_info)
|
||||
{
|
||||
g_warning ("plugin for type `%s' has no complete_interface_info() implementation",
|
||||
type_name);
|
||||
@@ -830,7 +815,7 @@ type_data_ref (TypeNode *node)
|
||||
|
||||
memset (&tmp_info, 0, sizeof (tmp_info));
|
||||
memset (&tmp_value_table, 0, sizeof (tmp_value_table));
|
||||
g_type_plugin_ref (node->plugin);
|
||||
g_type_plugin_use (node->plugin);
|
||||
g_type_plugin_complete_type_info (node->plugin, NODE_TYPE (node), &tmp_info, &tmp_value_table);
|
||||
check_type_info (pnode, G_TYPE_FUNDAMENTAL (NODE_TYPE (node)), NODE_NAME (node), &tmp_info);
|
||||
type_data_make (node, &tmp_info,
|
||||
@@ -930,7 +915,7 @@ type_iface_retrive_holder_info (TypeNode *iface,
|
||||
type_data_ref (iface);
|
||||
|
||||
memset (&tmp_info, 0, sizeof (tmp_info));
|
||||
g_type_plugin_ref (iholder->plugin);
|
||||
g_type_plugin_use (iholder->plugin);
|
||||
g_type_plugin_complete_interface_info (iholder->plugin, NODE_TYPE (iface), instance_type, &tmp_info);
|
||||
check_interface_info (iface, instance_type, &tmp_info);
|
||||
iholder->info = g_memdup (&tmp_info, sizeof (tmp_info));
|
||||
@@ -954,7 +939,7 @@ type_iface_blow_holder_info (TypeNode *iface,
|
||||
{
|
||||
g_free (iholder->info);
|
||||
iholder->info = NULL;
|
||||
g_type_plugin_unref (iholder->plugin);
|
||||
g_type_plugin_unuse (iholder->plugin);
|
||||
|
||||
type_data_unref (iface, FALSE);
|
||||
}
|
||||
@@ -1279,7 +1264,7 @@ type_data_last_unref (GType type,
|
||||
|
||||
if (ptype)
|
||||
type_data_unref (LOOKUP_TYPE_NODE (ptype), FALSE);
|
||||
g_type_plugin_unref (node->plugin);
|
||||
g_type_plugin_unuse (node->plugin);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2117,6 +2102,10 @@ g_type_init (void)
|
||||
type_data_make (node, &info, NULL); /* FIXME */
|
||||
g_assert (type == G_TYPE_INTERFACE);
|
||||
|
||||
/* G_TYPE_TYPE_PLUGIN
|
||||
*/
|
||||
g_type_plugin_get_type ();
|
||||
|
||||
/* G_TYPE_* value types
|
||||
*/
|
||||
g_value_types_init ();
|
||||
|
Reference in New Issue
Block a user