Skip to content

Commit

Permalink
store/restore via loop
Browse files Browse the repository at this point in the history
store/restore via loop
  • Loading branch information
djrecipe committed May 1, 2023
1 parent 81fb222 commit b70f3e0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions CefInteropStackUnwinding/Interop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ extern "C"
{
void InitializeCef()
{
// init handler storage
struct sigaction* dotnet_sigs = new struct sigaction[31];
struct sigaction* cef_sigs = new struct sigaction[31];
// store dotnet handlers
for(int i=0; i<31; i++)
{
memset(&dotnet_sigs[i], 0, sizeof(dotnet_sigs[i]));
memset(&cef_sigs[i], 0, sizeof(cef_sigs[i]));
sigaction(i, 0, &dotnet_sigs[i]);
}
// get current dir
char buff[FILENAME_MAX]; //create string buffer to hold path
getcwd(buff, FILENAME_MAX);
Expand All @@ -28,5 +38,10 @@ void InitializeCef()
// initialize!
CefProxy proxy;
CefInitialize(args, cef_settings, &proxy, NULL);
// restore dotnet handlers (and store cef handlers)
for (int i = 0; i < 31; i++)
{
sigaction(i, &dotnet_sigs[i], &cef_sigs[i]);
}
}
}
1 change: 1 addition & 0 deletions CefInteropStackUnwinding/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <exception>
#include <iostream>
#include <fstream>
#include <csignal>
#include <stack>
#include <stdarg.h>
#include <stdio.h>
Expand Down

0 comments on commit b70f3e0

Please sign in to comment.