8000 Add current view to active views before ShowWindow call, refer to htt… · uwydoc/tutorial-framework@1d5e0a8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1d5e0a8

Browse files
committed
Add current view to active views before ShowWindow call, refer to http://answers.awesomium.com/questions/1644/crash-on-windows-8-and-windows-xp-at-start.html for details
1 parent 238c8ff commit 1d5e0a8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/view_win.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,18 @@ class ViewWin : public View,
4545

4646
web_view_->set_parent_window(hwnd_);
4747

48+
// !!IMPORTANT!!
49+
// Add this view to active views before `ShowWindow', otherwise the program
50+
// would crash at startup in MS Windows(except Windows 7)
51+
// Refer to http://answers.awesomium.com/questions/1644/crash-on-windows-8-and-windows-xp-at-start.html for details
52+
g_active_views_.push_back(this);
53+
4854
ShowWindow(hwnd_, SW_SHOWNORMAL);
4955
UpdateWindow(hwnd_);
5056

5157
SetTimer (hwnd_, 0, 15, NULL );
5258

53-
g_active_views_.push_back(this);
59+
//g_active_views_.push_back(this);
5460
}
5561

5662
virtual ~ViewWin() {
@@ -170,4 +176,4 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
170176

171177
View* View::Create(int width, int height) {
172178
return new ViewWin(width, height);
173-
}
179+
}

0 commit comments

Comments
 (0)
0