add a SIGSEGV handler

This commit is contained in:
Maxime Coste 2013-01-23 13:46:18 +01:00
parent 2f9e061252
commit 9dbc6adcda

View File

@ -712,10 +712,18 @@ RemoteClient* connect_to(const String& pid, const String& init_command)
return remote_client;
}
void sigsegv_handler(int)
{
endwin();
on_assert_failed("Kakoune SEGFAULT !");
abort();
}
int main(int argc, char* argv[])
{
try
{
signal(SIGSEGV, sigsegv_handler);
std::vector<String> params;
for (size_t i = 1; i < argc; ++i)
params.push_back(argv[i]);