diff --git a/include/dialog.h b/include/dialog.h
index f340070830ef944d77e7a90c41cab4735873f948..ac3a14d30b1b545eaccb195830a6ca0e41a106a6 100644
--- a/include/dialog.h
+++ b/include/dialog.h
@@ -38,7 +38,6 @@ typedef struct
 #pragma pack(4)
 
 #define DF_END  0x0001
-#define DF_ENDING 0x0002
 
 extern BOOL32 DIALOG_Init(void);
 extern HWND32 DIALOG_CreateIndirect( HINSTANCE32 hInst, LPCSTR dlgTemplate,
diff --git a/windows/defdlg.c b/windows/defdlg.c
index 7e1fdf576d4689c4de571783f19b108e855ddbfd..01fb79f5c3a7486f7f164e47dbea56575d916615 100644
--- a/windows/defdlg.c
+++ b/windows/defdlg.c
@@ -266,12 +266,6 @@ LRESULT WINAPI DefDlgProc16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam,
         /* 16 bit dlg procs only return BOOL16 */
         if( WINPROC_GetProcType( dlgInfo->dlgProc ) == WIN_PROC_16 )
             result = LOWORD(result);
-
-        /* Check if window was destroyed by dialog procedure */
-        if (dlgInfo->flags & DF_END && !(dlgInfo->flags & DF_ENDING)) {
-            dlgInfo->flags |= DF_ENDING;
-            DestroyWindow32( hwnd );
-        }
     }
 
     if (!result && IsWindow32(hwnd))
@@ -329,12 +323,6 @@ LRESULT WINAPI DefDlgProc32A( HWND32 hwnd, UINT32 msg,
         /* 16 bit dlg procs only return BOOL16 */
         if( WINPROC_GetProcType( dlgInfo->dlgProc ) == WIN_PROC_16 )
             result = LOWORD(result);
-
-        /* Check if window was destroyed by dialog procedure */
-        if (dlgInfo->flags & DF_END && !(dlgInfo->flags & DF_ENDING)) {
-            dlgInfo->flags |= DF_ENDING;
-            DestroyWindow32( hwnd );
-        }
     }
 
     if (!result && IsWindow32(hwnd))
@@ -392,12 +380,6 @@ LRESULT WINAPI DefDlgProc32W( HWND32 hwnd, UINT32 msg, WPARAM32 wParam,
         /* 16 bit dlg procs only return BOOL16 */
         if( WINPROC_GetProcType( dlgInfo->dlgProc ) == WIN_PROC_16 )
             result = LOWORD(result);
-
-        /* Check if window was destroyed by dialog procedure */
-        if (dlgInfo->flags & DF_END && !(dlgInfo->flags & DF_ENDING)) {
-            dlgInfo->flags |= DF_ENDING;
-            DestroyWindow32( hwnd );
-        }
     }
 
     if (!result && IsWindow32(hwnd))
diff --git a/windows/dialog.c b/windows/dialog.c
index afc4fa8f5b9e00603685b67d4ba51fffe0a43cd9..e1a31e137926886ffd3a97ed3d5e309a54177cd8 100644
--- a/windows/dialog.c
+++ b/windows/dialog.c
@@ -869,7 +869,6 @@ INT32 DIALOG_DoDialogBox( HWND32 hwnd, HWND32 owner )
     }
     retval = dlgInfo->idResult;
     EnableWindow32( owner, TRUE );
-    dlgInfo->flags |= DF_ENDING;   /* try to stop it being destroyed twice */
     DestroyWindow32( hwnd );
     return retval;
 }