Standard NSIS 2.46 using MUI2, WinXP SP3 (and Win2000).
I rewrote my installer to decide if the page will be shown before calling Create, so I don't have the problem anymore, but this smells like a bug.
Don
OutFile Test.exe
!include "MUI2.nsh"
!insertmacro MUI_PAGE_WELCOME
Page custom MyPage
!define MUI_PAGE_CUSTOMFUNCTION_PRE Finish.Pre
!define MUI_PAGE_CUSTOMFUNCTION_SHOW Finish.Show
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE "English"
Section
SectionEnd
Function MyPage
${IfCmd} MessageBox MB_OKCANCEL "OK = Call nsDialogs::Create$\nCancel = Abort the custom page" IDCANCEL ${||} Abort ${|}
nsDialogs::Create 1018
Pop $0
${IfCmd} MessageBox MB_OKCANCEL "OK = Show the custom page$\nCancel = Abort the custom page / Crash" IDCANCEL ${||} Abort ${|}
!insertmacro MUI_HEADER_TEXT "Custom page" "Aborting a custom page after the inner dialog is created crashes the installer."
nsDialogs::Show
FunctionEnd
Function Finish.Pre
MessageBox MB_OK "This is the Pre callback"
FunctionEnd
Function Finish.Show
MessageBox MB_OK "This is the Show callback"
FunctionEnd