forked from mirrors/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:
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user