MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / hb_global_close

Function hb_global_close

libhb/hb.c:2214–2242  ·  view source on GitHub ↗

* Cleans up libhb at a process level. Call before the app closes. Removes preview directory. */

Source from the content-addressed store, hash-verified

2212 * Cleans up libhb at a process level. Call before the app closes. Removes preview directory.
2213 */
2214void hb_global_close()
2215{
2216 const char * dirname;
2217 DIR * dir;
2218 struct dirent * entry;
2219
2220 hb_presets_free();
2221
2222 /* Find and remove temp folder */
2223 dirname = hb_get_temporary_directory();
2224
2225 dir = opendir( dirname );
2226 if (dir)
2227 {
2228 while( ( entry = readdir( dir ) ) )
2229 {
2230 char * filename;
2231 if( entry->d_name[0] == '.' )
2232 {
2233 continue;
2234 }
2235 filename = hb_strdup_printf("%s/%s", dirname, entry->d_name);
2236 unlink( filename );
2237 free(filename);
2238 }
2239 closedir( dir );
2240 rmdir( dirname );
2241 }
2242}
2243
2244/**
2245 * Monitors the state of the update, scan, and work threads.

Callers 2

mainFunction · 0.85
ghb_backend_closeFunction · 0.85

Calls 3

hb_presets_freeFunction · 0.85
hb_strdup_printfFunction · 0.85

Tested by 1

mainFunction · 0.68