OpenShot Library | libopenshot
1.1.1
Toggle main menu visibility
Loading...
Searching...
No Matches
CrashHandler.h
Go to the documentation of this file.
1
8
9
// Copyright (c) 2008-2019 OpenShot Studios, LLC
10
//
11
// SPDX-License-Identifier: LGPL-3.0-or-later
12
13
#ifndef OPENSHOT_CRASH_HANDLER_H
14
#define OPENSHOT_CRASH_HANDLER_H
15
16
#include <cstdlib>
17
#include <stdio.h>
18
#include <signal.h>
19
#ifdef __MINGW32__
20
#include <winsock2.h>
21
#include <windows.h>
22
#include <DbgHelp.h>
23
#else
24
#include <execinfo.h>
25
#endif
26
#include <errno.h>
27
#include <cxxabi.h>
28
#include "
Logger.h
"
29
30
namespace
openshot
{
31
38
class
CrashHandler {
39
private
:
41
CrashHandler(){
return
;};
// Don't allow user to create an instance of this singleton
42
44
//CrashHandler(CrashHandler const&){}; // Don't allow the user to copy this instance
45
CrashHandler(CrashHandler
const
&) =
delete
;
// Don't allow the user to copy this instance
46
48
CrashHandler & operator=(CrashHandler
const
&) =
delete
;
// Don't allow the user to assign this instance
49
51
static
CrashHandler *m_pInstance;
52
53
public
:
56
static
CrashHandler *
Instance
();
57
58
#ifdef __MINGW32__
59
// TODO: Windows exception handling methods
60
static
void
abortHandler
(
int
signum);
61
#else
63
static
void
abortHandler
(
int
signum, siginfo_t* si,
void
* unused);
64
#endif
65
67
static
void
printStackTrace
(FILE *out,
unsigned
int
max_frames);
68
};
69
70
}
71
72
#endif
Logger.h
openshot::CrashHandler::abortHandler
static void abortHandler(int signum, siginfo_t *si, void *unused)
Method which handles crashes and logs error.
Definition
CrashHandler.cpp:85
openshot::CrashHandler::printStackTrace
static void printStackTrace(FILE *out, unsigned int max_frames)
Method which prints a stacktrace.
Definition
CrashHandler.cpp:113
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
AnimatedCurve.h:24
CrashHandler.h
Generated by
1.17.0