Skip to content

OnAbort

Description

Register a custom callback function invoked when Abort runs. If no callback is registered, Abort traps directly.

Parameters

Name Direction Description
callback in Function to call when Abort is invoked, or NULL to reset to default.

Success

Callback is registered.

Failure

Function cannot fail.

Usage example (Cross-references)

Usage examples (Cross-references)
    static AbortCallback g_abort_callback = NULL;
    
    void OnAbort(AbortCallback callback) {
        g_abort_callback = callback;
    }
    
        // Install the abort capture handler for the duration of this call.
        OnAbort(test_abort_handler);
    
        bool test_result = false;
    
        // Restore the default abort path before returning.
        OnAbort(NULL);
    
        return test_result;
Last updated on