Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/sphinx/reference-libobs-util-base.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Logging Functions
.. function:: void base_set_crash_handler(void (*handler)(const char *, va_list, void *), void *param)

Sets the current crash handler.
This may only be set once.

---------------------

Expand Down
9 changes: 9 additions & 0 deletions libobs/util/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@ void base_set_log_handler(log_handler_t handler, void *param)

void base_set_crash_handler(void (*handler)(const char *, va_list, void *), void *param)
{
static bool non_default_handler_set = false;

if (non_default_handler_set) {
blog(LOG_ERROR, "Tried to set a crash handler when one already exists. "
"This is unsupported.");
return;
}

non_default_handler_set = true;
crash_param = param;
crash_handler = handler;
}
Expand Down