1
0
forked from 0ad/0ad

add support for forcibly closing cached files (needed when closing all active sounds before resetting openal)

This was SVN commit r1261.
This commit is contained in:
janwas 2004-10-20 00:58:55 +00:00
parent 0afc3c159d
commit 1ef7ce088c
2 changed files with 13 additions and 1 deletions

View File

@ -716,6 +716,15 @@ Handle h_find(H_Type type, uintptr_t key)
}
int h_allow_free(Handle h, H_Type type)
{
HDATA* hd = h_data(h, type);
if(!hd)
return ERR_INVALID_HANDLE;
hd->keep_open = 0;
return 0;
}
int res_cur_scope;

View File

@ -201,7 +201,10 @@ extern int h_reload(const char* fn);
extern int res_cur_scope;
// disable caching and allow the handle to actually be freed when refcount
// is at 0. used when cached resources must be closed before exit,
// e.g. sounds when reinitializing OpenAL (due to changed settings).
extern int h_allow_free(Handle h, H_Type type);
extern void h_mgr_shutdown();