Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows version crash and the reason is in class ViewWin's constructor #3

Open
bbsteel opened this issue Aug 13, 2014 · 4 comments
Open

Comments

@bbsteel
Copy link

bbsteel commented Aug 13, 2014

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.

@Enelar
Copy link

Enelar commented Aug 27, 2014

@bbsteel why you didnt use github links?
He mean move that to line 30.

@bbsteel
Copy link
Author

bbsteel commented Aug 27, 2014

@Enelar Sorry I am new to github.
Now I see every source line is a link, thanks.

@Enelar
Copy link

Enelar commented Aug 27, 2014

@bbsteel not blaming you. Just my style to give advices. Group of lines still link too(file#L10-20). Everything is link. Commit, diff, diff lines, function, class etc. etc.

@Enelar Enelar mentioned this issue Aug 27, 2014
@Enelar
Copy link

Enelar commented Jul 3, 2015

@adamjs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants