summaryrefslogtreecommitdiff
path: root/src/origexception.cpp
blob: f64d69621e5140a03c2000b90130c1399e7a0f92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/**
 *  Implementation of the exception that was originally thrown by PHP
 *  code or the zend engine, and that could or could not be picked
 *  up by C++ code
 *
 *  @author Emiel Bruijntjes <emiel.bruijntjes@copernica.com>
 *  @copyright 2013 Copernica BV
 */
#include "includes.h"

/**
 *  Set up namespace
 */
namespace Php {

/**
 *  Destructor
 */
OrigException::~OrigException() noexcept
{
    // skip if the exception was restored
    if (_restored) return;
    
    // we need the tsrm_ls var
    TSRMLS_FETCH();
    
    // clean up the exception, because it was handled in C++ code
    zend_clear_exception(TSRMLS_C);
}

/**
 *  End of namespace
 */
}