Loading...
Searching...
No Matches
CrashHandler.h
Go to the documentation of this file.
// Copyright (c) 2008-2019 OpenShot Studios, LLC
//
// SPDX-License-Identifier: LGPL-3.0-or-later
#ifndef OPENSHOT_CRASH_HANDLER_H
#define OPENSHOT_CRASH_HANDLER_H
#include <cstdlib>
#include <stdio.h>
#include <signal.h>
#ifdef __MINGW32__
#include <winsock2.h>
#include <windows.h>
#include <DbgHelp.h>
#else
#include <execinfo.h>
#endif
#include <errno.h>
#include <cxxabi.h>
#include "ZmqLogger.h"
namespace openshot {
class CrashHandler {
private:
CrashHandler(){return;}; // Don't allow user to create an instance of this singleton
//CrashHandler(CrashHandler const&){}; // Don't allow the user to copy this instance
CrashHandler(CrashHandler const&) = delete; // Don't allow the user to copy this instance
CrashHandler & operator=(CrashHandler const&) = delete; // Don't allow the user to assign this instance
static CrashHandler *m_pInstance;
public:
static CrashHandler *Instance();
#ifdef __MINGW32__
// TODO: Windows exception handling methods
static void abortHandler(int signum);
#else
static void abortHandler(int signum, siginfo_t* si, void* unused);
#endif
static void printStackTrace(FILE *out, unsigned int max_frames);
};
}
#endif
ZmqLogger.h
Header file for ZeroMQ-based Logger class.
openshot::CrashHandler::abortHandler
static void abortHandler(int signum, siginfo_t *si, void *unused)
Method which handles crashes and logs error.
Definition CrashHandler.cpp:84
openshot::CrashHandler::printStackTrace
static void printStackTrace(FILE *out, unsigned int max_frames)
Method which prints a stacktrace.
Definition CrashHandler.cpp:112
openshot::CrashHandler::Instance
static CrashHandler * Instance()
Definition CrashHandler.cpp:27
openshot
This namespace is the default namespace for all code in the openshot library.
Definition Compressor.h:29