]> git.street.me.uk Git - andy/viking.git/blobdiff - src/vikgobjectbuilder.c
Fix waypoints may not be drawn when created by paste of a text location.
[andy/viking.git] / src / vikgobjectbuilder.c
index 9867d9316a3b3798fa861a383bc385097b5f0af2..f864837487bd52856e09cd4fbd8683f984347364 100644 (file)
@@ -5,7 +5,7 @@
  * 
  * viking is free software: you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
  * 
  * viking is free software: you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
+ * Free Software Foundation, either version 2 of the License, or
  * (at your option) any later version.
  * 
  * viking is distributed in the hope that it will be useful, but
  * (at your option) any later version.
  * 
  * viking is distributed in the hope that it will be useful, but
@@ -34,7 +34,6 @@
 #include "vikgobjectbuilder.h"
 
 /* FIXME use private fields */
 #include "vikgobjectbuilder.h"
 
 /* FIXME use private fields */
-static gchar *class_name = NULL;
 GType gtype = 0;
 gchar *property_name = NULL;
 GParameter *parameters = NULL;
 GType gtype = 0;
 gchar *property_name = NULL;
 GParameter *parameters = NULL;
@@ -104,13 +103,14 @@ _start_element (GMarkupParseContext *context,
 {
        if (strcmp(element_name, "object") == 0)
        {
 {
        if (strcmp(element_name, "object") == 0)
        {
-               class_name = g_strdup(attribute_values[0]);
+               gchar *class_name = g_strdup(attribute_values[0]);
                gtype = g_type_from_name (class_name);
                if (gtype == 0)
                {
                        g_warning("Unknown GObject type '%s'", class_name);
                        return;
                }
                gtype = g_type_from_name (class_name);
                if (gtype == 0)
                {
                        g_warning("Unknown GObject type '%s'", class_name);
                        return;
                }
+               g_free (class_name);
        }
        if (strcmp(element_name, "property") == 0 && gtype != 0)
        {
        }
        if (strcmp(element_name, "property") == 0 && gtype != 0)
        {