msi: Create a function to free control data.
This commit is contained in:
parent
fbfc221a77
commit
6a2fb05451
|
@ -373,6 +373,23 @@ static UINT msi_dialog_build_font_list( msi_dialog *dialog )
|
|||
return r;
|
||||
}
|
||||
|
||||
static void msi_destroy_control( msi_control *t )
|
||||
{
|
||||
list_remove( &t->entry );
|
||||
/* leave dialog->hwnd - destroying parent destroys child windows */
|
||||
msi_free( t->property );
|
||||
msi_free( t->value );
|
||||
if( t->hBitmap )
|
||||
DeleteObject( t->hBitmap );
|
||||
if( t->hIcon )
|
||||
DestroyIcon( t->hIcon );
|
||||
msi_free( t->tabnext );
|
||||
msi_free( t->type );
|
||||
if (t->hDll)
|
||||
FreeLibrary( t->hDll );
|
||||
msi_free( t );
|
||||
}
|
||||
|
||||
static msi_control *msi_dialog_create_window( msi_dialog *dialog,
|
||||
MSIRECORD *rec, DWORD exstyle, LPCWSTR szCls, LPCWSTR name, LPCWSTR text,
|
||||
DWORD style, HWND parent )
|
||||
|
@ -3377,21 +3394,11 @@ void msi_dialog_destroy( msi_dialog *dialog )
|
|||
/* destroy the list of controls */
|
||||
while( !list_empty( &dialog->controls ) )
|
||||
{
|
||||
msi_control *t = LIST_ENTRY( list_head( &dialog->controls ),
|
||||
msi_control *t;
|
||||
|
||||
t = LIST_ENTRY( list_head( &dialog->controls ),
|
||||
msi_control, entry );
|
||||
list_remove( &t->entry );
|
||||
/* leave dialog->hwnd - destroying parent destroys child windows */
|
||||
msi_free( t->property );
|
||||
msi_free( t->value );
|
||||
if( t->hBitmap )
|
||||
DeleteObject( t->hBitmap );
|
||||
if( t->hIcon )
|
||||
DestroyIcon( t->hIcon );
|
||||
msi_free( t->tabnext );
|
||||
msi_free( t->type );
|
||||
if (t->hDll)
|
||||
FreeLibrary( t->hDll );
|
||||
msi_free( t );
|
||||
msi_destroy_control( t );
|
||||
}
|
||||
|
||||
/* destroy the list of fonts */
|
||||
|
|
Loading…
Reference in New Issue