]> git.proxmox.com Git - mirror_qemu.git/blobdiff - qobject/qstring.c
Revert "qstring: add qstring_free()"
[mirror_qemu.git] / qobject / qstring.c
index af7c18ca73864e50b00b1a86f6b3ee7bd9d00d66..c1891beda0da922d428872e8b6a82a45616e2e6a 100644 (file)
@@ -168,33 +168,16 @@ bool qstring_is_equal(const QObject *x, const QObject *y)
                    qobject_to(QString, y)->string);
 }
 
-/**
- * qstring_free(): Free the memory allocated by a QString object
- *
- * Return: if @return_str, return the underlying string, to be
- * g_free(), otherwise NULL is returned.
- */
-char *qstring_free(QString *qstring, bool return_str)
-{
-    char *rv = NULL;
-
-    if (return_str) {
-        rv = qstring->string;
-    } else {
-        g_free(qstring->string);
-    }
-
-    g_free(qstring);
-
-    return rv;
-}
-
 /**
  * qstring_destroy_obj(): Free all memory allocated by a QString
  * object
  */
 void qstring_destroy_obj(QObject *obj)
 {
+    QString *qs;
+
     assert(obj != NULL);
-    qstring_free(qobject_to(QString, obj), FALSE);
+    qs = qobject_to(QString, obj);
+    g_free(qs->string);
+    g_free(qs);
 }