cpw.caseyho.crashreporter: 9d46bf20: Adding utility method to create minimal ...

caseyho at pidgin.im caseyho at pidgin.im
Fri Feb 13 19:35:42 EST 2009


-----------------------------------------------------------------
Revision: 9d46bf20ea1299025d3f1240a2c2df0cf724762f
Ancestor: 05227977db445a29b536652aed5517789744d245
Author: caseyho at pidgin.im
Date: 2009-02-13T20:37:09
Branch: im.pidgin.cpw.caseyho.crashreporter
URL: http://d.pidgin.im/viewmtn/revision/info/9d46bf20ea1299025d3f1240a2c2df0cf724762f

Modified files:
        libpurple/core.c libpurple/core.h

ChangeLog: 

Adding utility method to create minimal libpurple startup mode.  Will be used as "safe mode" for crash reporter.


-------------- next part --------------
============================================================
--- libpurple/core.c	40b118e2362d5ee7307b5279e7e8a0b75dab2fc1
+++ libpurple/core.c	fb5b56b902fac4a20e9a08684a8e353f1bdd34b4
@@ -75,6 +75,14 @@ STATIC_PROTO_INIT
 
 STATIC_PROTO_INIT
 
+void
+purple_core_create(const char *ui)
+{
+	_core = g_new0(PurpleCore, 1);
+	_core->ui = g_strdup(ui);
+	_core->reserved = NULL;
+}
+
 gboolean
 purple_core_init(const char *ui)
 {
@@ -93,9 +101,8 @@ purple_core_init(const char *ui)
 
 	g_type_init();
 
-	_core = core = g_new0(PurpleCore, 1);
-	core->ui = g_strdup(ui);
-	core->reserved = NULL;
+	purple_core_create(ui);
+	core = _core;
 
 	ops = purple_core_get_ui_ops();
 
============================================================
--- libpurple/core.h	051c1a04d628b308360ce23e24e618a82ad1d5e4
+++ libpurple/core.h	f5cc720b8469776ebfb4319a6157feec8881009c
@@ -132,6 +132,14 @@ PurpleCore *purple_get_core(void);
 PurpleCore *purple_get_core(void);
 
 /**
+ * Creates the core itself, but does no other initializations.
+ *
+ * This is used by purple_core_init, and to create a "safe mode" where
+ * minimal code is executed.
+ */
+void purple_core_create(const char *ui);
+
+/**
  * Sets the UI ops for the core.
  *
  * @param ops A UI ops structure for the core.


More information about the Commits mailing list