msi: Free the handle table on PROCESS_DETACH.

This commit is contained in:
Mike McCormack 2006-08-29 17:08:01 +09:00 committed by Alexandre Julliard
parent ada5daa76a
commit 155a325f96
3 changed files with 12 additions and 3 deletions

View File

@ -60,6 +60,13 @@ typedef struct msi_handle_info_t
static msi_handle_info *msihandletable = NULL;
static int msihandletable_size = 0;
void msi_free_handle_table(void)
{
msi_free( msihandletable );
msihandletable = NULL;
msihandletable_size = 0;
}
MSIHANDLE alloc_msihandle( MSIOBJECTHDR *obj )
{
MSIHANDLE ret = 0;
@ -81,11 +88,11 @@ MSIHANDLE alloc_msihandle( MSIOBJECTHDR *obj )
p = msi_alloc_zero(newsize*sizeof(msi_handle_info));
}
else
{
{
newsize = msihandletable_size * 2;
p = msi_realloc_zero(msihandletable,
newsize*sizeof(msi_handle_info));
}
}
if (!p)
goto out;
msihandletable = p;

View File

@ -72,6 +72,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
break;
case DLL_PROCESS_DETACH:
msi_dialog_unregister_class();
msi_free_handle_table();
break;
}
return TRUE;

View File

@ -306,6 +306,7 @@ extern void msiobj_addref(MSIOBJECTHDR *);
extern int msiobj_release(MSIOBJECTHDR *);
extern void msiobj_lock(MSIOBJECTHDR *);
extern void msiobj_unlock(MSIOBJECTHDR *);
extern void msi_free_handle_table(void);
extern void free_cached_tables( MSIDATABASE *db );
extern void msi_free_transforms( MSIDATABASE *db );