mirror of
https://github.com/yuzu-emu/unicorn
synced 2024-11-25 05:29:11 +00:00
35 lines
851 B
C
35 lines
851 B
C
|
/*
|
||
|
* QObject
|
||
|
*
|
||
|
* Copyright (C) 2015 Red Hat, Inc.
|
||
|
*
|
||
|
* This work is licensed under the terms of the GNU LGPL, version 2.1
|
||
|
* or later. See the COPYING.LIB file in the top-level directory.
|
||
|
*/
|
||
|
|
||
|
#include "qemu-common.h"
|
||
|
#include "qapi/qmp/qbool.h"
|
||
|
#include "qapi/qmp/qdict.h"
|
||
|
#include "qapi/qmp/qfloat.h"
|
||
|
#include "qapi/qmp/qint.h"
|
||
|
#include "qapi/qmp/qlist.h"
|
||
|
#include "qapi/qmp/qstring.h"
|
||
|
|
||
|
static void (*qdestroy[QTYPE_MAX])(QObject *) = {
|
||
|
NULL, /* No such object exists */
|
||
|
NULL, /* qnull_ is indestructible */
|
||
|
qint_destroy_obj,
|
||
|
qstring_destroy_obj,
|
||
|
qdict_destroy_obj,
|
||
|
qlist_destroy_obj,
|
||
|
qfloat_destroy_obj,
|
||
|
qbool_destroy_obj,
|
||
|
};
|
||
|
|
||
|
void qobject_destroy(QObject *obj)
|
||
|
{
|
||
|
assert(!obj->refcnt);
|
||
|
assert(QTYPE_QNULL < obj->type && obj->type < QTYPE_MAX);
|
||
|
qdestroy[obj->type](obj);
|
||
|
}
|