* Closes access to libhb by freeing the hb_handle_t handle contained in hb_init. * @param _h Pointer to handle to hb_handle_t. */
| 2111 | * @param _h Pointer to handle to hb_handle_t. |
| 2112 | */ |
| 2113 | void hb_close( hb_handle_t ** _h ) |
| 2114 | { |
| 2115 | hb_handle_t * h = *_h; |
| 2116 | hb_title_t * title; |
| 2117 | |
| 2118 | h->die = 1; |
| 2119 | |
| 2120 | hb_thread_close( &h->main_thread ); |
| 2121 | |
| 2122 | while( ( title = hb_list_item( h->title_set.list_title, 0 ) ) ) |
| 2123 | { |
| 2124 | hb_list_rem( h->title_set.list_title, title ); |
| 2125 | hb_title_close( &title ); |
| 2126 | } |
| 2127 | hb_list_close( &h->title_set.list_title ); |
| 2128 | free((char*)h->title_set.path); |
| 2129 | h->title_set.path = NULL; |
| 2130 | |
| 2131 | hb_list_close( &h->jobs ); |
| 2132 | hb_lock_close( &h->state_lock ); |
| 2133 | hb_lock_close( &h->pause_lock ); |
| 2134 | |
| 2135 | hb_system_sleep_opaque_close(&h->system_sleep_opaque); |
| 2136 | |
| 2137 | free( h->interjob ); |
| 2138 | |
| 2139 | free( h ); |
| 2140 | *_h = NULL; |
| 2141 | } |
| 2142 | |
| 2143 | int hb_global_init_no_hardware() |
| 2144 | { |