Skip to content

Commit

Permalink
Don't crash on wrong web form name in bangs
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe committed Aug 15, 2011
1 parent 1465971 commit dbfefd8
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions lsad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,45 +137,57 @@ LRESULT LSAD::InstanceWndProc(UINT msg, WPARAM wParam, LPARAM lParam)
case LSAD_BANGNAVIGATE: {
std::string *name = reinterpret_cast<std::string*>(wParam);
std::string *url = reinterpret_cast<std::string*>(lParam);
webWindows[*name]->webForm->Go(url->c_str());
if (webWindows[*name]) {
webWindows[*name]->webForm->Go(url->c_str());
}
delete url;
delete name;

break;
}
case LSAD_BANGBACK: {
std::string *name = reinterpret_cast<std::string*>(wParam);
webWindows[*name]->webForm->Back();
if (webWindows[*name]) {
webWindows[*name]->webForm->Back();
}
delete name;

break;
}
case LSAD_BANGFORWARD: {
std::string *name = reinterpret_cast<std::string*>(wParam);
webWindows[*name]->webForm->Forward();
if (webWindows[*name]) {
webWindows[*name]->webForm->Forward();
}
delete name;

break;
}
case LSAD_BANGRUNJSFUNCTION: {
std::string *name = reinterpret_cast<std::string*>(wParam);
std::string *cmd = reinterpret_cast<std::string*>(lParam);
webWindows[*name]->webForm->RunJSFunction(*cmd);
if (webWindows[*name]) {
webWindows[*name]->webForm->RunJSFunction(*cmd);
}
delete cmd;
delete name;

break;
}
case LSAD_BANGREFRESH: {
std::string *name = reinterpret_cast<std::string*>(wParam);
webWindows[*name]->webForm->Refresh(false);
if (webWindows[*name]) {
webWindows[*name]->webForm->Refresh(false);
}
delete name;

break;
}
case LSAD_BANGREFRESHCACHE: {
std::string *name = reinterpret_cast<std::string*>(wParam);
webWindows[*name]->webForm->Refresh(true);
if (webWindows[*name]) {
webWindows[*name]->webForm->Refresh(true);
}
delete name;

break;
Expand Down

0 comments on commit dbfefd8

Please sign in to comment.