Commit ead00327 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

msi: Unload riched20 after its window is destroyed.

parent abbe4b6d
...@@ -59,6 +59,7 @@ struct msi_control_tag ...@@ -59,6 +59,7 @@ struct msi_control_tag
HBITMAP hBitmap; HBITMAP hBitmap;
HICON hIcon; HICON hIcon;
LPWSTR tabnext; LPWSTR tabnext;
HMODULE hDll;
WCHAR name[1]; WCHAR name[1];
}; };
...@@ -328,6 +329,7 @@ static msi_control *msi_dialog_create_window( msi_dialog *dialog, ...@@ -328,6 +329,7 @@ static msi_control *msi_dialog_create_window( msi_dialog *dialog,
control->value = NULL; control->value = NULL;
control->hBitmap = NULL; control->hBitmap = NULL;
control->hIcon = NULL; control->hIcon = NULL;
control->hDll = NULL;
control->tabnext = strdupW( MSI_RecordGetString( rec, 11) ); control->tabnext = strdupW( MSI_RecordGetString( rec, 11) );
x = MSI_RecordGetInteger( rec, 4 ); x = MSI_RecordGetInteger( rec, 4 );
...@@ -700,7 +702,6 @@ struct msi_scrolltext_info ...@@ -700,7 +702,6 @@ struct msi_scrolltext_info
msi_dialog *dialog; msi_dialog *dialog;
msi_control *control; msi_control *control;
WNDPROC oldproc; WNDPROC oldproc;
HMODULE hRichedit;
}; };
static LRESULT WINAPI static LRESULT WINAPI
...@@ -718,7 +719,6 @@ MSIScrollText_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) ...@@ -718,7 +719,6 @@ MSIScrollText_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
switch( msg ) switch( msg )
{ {
case WM_NCDESTROY: case WM_NCDESTROY:
FreeLibrary( info->hRichedit );
msi_free( info ); msi_free( info );
RemovePropW( hWnd, szButtonData ); RemovePropW( hWnd, szButtonData );
break; break;
...@@ -778,24 +778,27 @@ static UINT msi_dialog_scrolltext_control( msi_dialog *dialog, MSIRECORD *rec ) ...@@ -778,24 +778,27 @@ static UINT msi_dialog_scrolltext_control( msi_dialog *dialog, MSIRECORD *rec )
}; };
struct msi_scrolltext_info *info; struct msi_scrolltext_info *info;
msi_control *control; msi_control *control;
HMODULE hRichedit;
DWORD style; DWORD style;
info = msi_alloc( sizeof *info ); info = msi_alloc( sizeof *info );
if (!info) if (!info)
return ERROR_FUNCTION_FAILED; return ERROR_FUNCTION_FAILED;
info->hRichedit = LoadLibraryA("riched20"); hRichedit = LoadLibraryA("riched20");
style = WS_BORDER | ES_MULTILINE | WS_VSCROLL | style = WS_BORDER | ES_MULTILINE | WS_VSCROLL |
ES_READONLY | ES_AUTOVSCROLL | WS_TABSTOP; ES_READONLY | ES_AUTOVSCROLL | WS_TABSTOP;
control = msi_dialog_add_control( dialog, rec, szRichEdit20W, style ); control = msi_dialog_add_control( dialog, rec, szRichEdit20W, style );
if (!control) if (!control)
{ {
FreeLibrary( info->hRichedit ); FreeLibrary( hRichedit );
msi_free( info ); msi_free( info );
return ERROR_FUNCTION_FAILED; return ERROR_FUNCTION_FAILED;
} }
control->hDll = hRichedit;
info->dialog = dialog; info->dialog = dialog;
info->control = control; info->control = control;
...@@ -2212,6 +2215,8 @@ void msi_dialog_destroy( msi_dialog *dialog ) ...@@ -2212,6 +2215,8 @@ void msi_dialog_destroy( msi_dialog *dialog )
DestroyIcon( t->hIcon ); DestroyIcon( t->hIcon );
msi_free( t->tabnext ); msi_free( t->tabnext );
msi_free( t ); msi_free( t );
if (t->hDll)
FreeLibrary( t->hDll );
} }
/* destroy the list of fonts */ /* destroy the list of fonts */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment