I follow the readme and setting up and building project is fine, but when I run the project , it crashed.
After some analysis, I found the reason is in class ViewWin's constructor.
Before pushing back ViewWin's self pointer to the global view* vector
( the line g_active_views_.push_back(this); is in the end of ViewWin()),
Callback function WndProc() already get the pointer.
(ViewWin* view = ViewWin::GetFromHandle(hWnd);) .
So it will get a null ViewWin pointer in WndProc() , then on WM_SIZE message , function call on null pointer cause crash.
To fix it, in ViewWin(), move g_active_views_.push_back(this); before CreateWindow line.
I follow the readme and setting up and building project is fine, but when I run the project , it crashed.
After some analysis, I found the reason is in class ViewWin's constructor.
Before pushing back ViewWin's self pointer to the global view* vector
( the line
g_active_views_.push_back(this);is in the end ofViewWin()),Callback function
WndProc()already get the pointer.(
ViewWin* view = ViewWin::GetFromHandle(hWnd);) .So it will get a null ViewWin pointer in
WndProc(), then on WM_SIZE message , function call on null pointer cause crash.To fix it, in
ViewWin(), moveg_active_views_.push_back(this);beforeCreateWindowline.