2 * Copyright (C) 2012 Toni Gundogdu <legatvs@gmail.com>
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
31 #include "_quvi_script_s.h"
33 #include "misc/script_free.h"
36 extern void c_close(_quvi_t
);
39 /** @brief Free all of memory used by a library handle
40 @note If handle is NULL the function simply returns
41 @sa @ref getting_started
44 void quvi_free(quvi_t handle
)
46 _quvi_t q
= (_quvi_t
) handle
;
55 g_string_free(q
->status
.errmsg
, TRUE
);
56 q
->status
.errmsg
= NULL
;
58 g_string_free(q
->opt
.format
, TRUE
);
64 g_slist_free_full(q
->scripts
.playlist
, m_script_free
);
66 g_slist_foreach(q
->scripts
.playlist
, m_script_free
, NULL
);
67 g_slist_free(q
->scripts
.playlist
);
69 q
->scripts
.playlist
= NULL
;
72 g_slist_free_full(q
->scripts
.media
, m_script_free
);
74 g_slist_foreach(q
->scripts
.media
, m_script_free
, NULL
);
75 g_slist_free(q
->scripts
.media
);
77 q
->scripts
.media
= NULL
;
80 g_slist_free_full(q
->scripts
.scan
, m_script_free
);
82 g_slist_foreach(q
->scripts
.scan
, m_script_free
, NULL
);
83 g_slist_free(q
->scripts
.scan
);
85 q
->scripts
.scan
= NULL
;
88 g_slist_free_full(q
->scripts
.util
, m_script_free
);
90 g_slist_foreach(q
->scripts
.util
, m_script_free
, NULL
);
91 g_slist_free(q
->scripts
.util
);
93 q
->scripts
.util
= NULL
;
97 if (q
->handle
.lua
!= NULL
)
99 lua_close(q
->handle
.lua
);
100 q
->handle
.lua
= NULL
;
103 if (q
->handle
.proxy
!= NULL
)
105 px_proxy_factory_free(q
->handle
.proxy
);
106 q
->handle
.proxy
= NULL
;
113 /* vim: set ts=2 sw=2 tw=72 expandtab: */