Project

Profile

Help

Revision 00082f6f

Added by O'Neil Delpratt 8 months ago

Saxon/C bug fixes

View differences:

src/main/c/Saxon.C.API/SaxonProcessor.cpp
28 28
int SaxonProcessor::jvmCreatedCPP = 0;
29 29

  
30 30
bool SaxonProcessor::exceptionOccurred() {
31
    bool found = SaxonProcessor::sxn_environ->env->ExceptionCheck();
32
    return found;
31
    return SaxonProcessor::sxn_environ->env->ExceptionCheck() || exception != nullptr;
33 32
}
34 33

  
35 34
const char *SaxonProcessor::checkException(jobject cpp) {
......
39 38
}
40 39

  
41 40
SaxonApiException *SaxonProcessor::checkAndCreateException(jclass cppClass) {
42
    if (exceptionOccurred()) {
41
    if (SaxonProcessor::sxn_environ->env->ExceptionCheck()) {
43 42
        SaxonApiException *exception = checkForExceptionCPP(SaxonProcessor::sxn_environ->env, cppClass, nullptr);
44 43
#ifdef DEBUG
45 44
        SaxonProcessor::sxn_environ->env->ExceptionDescribe();
......
60 59

  
61 60
void SaxonProcessor::exceptionClear() {
62 61
    SaxonProcessor::sxn_environ->env->ExceptionClear();
63
    /* if(exception != nullptr && clearCPPException) {
64
        delete exception;
65
    } */
62

  
66 63
}
67 64

  
68 65

  
......
629 626

  
630 627

  
631 628
    if (!proc) {
632
        std::cout << "proc is null in SaxonProcessor.setCatalog" << std::endl;
629
        exception = new SaxonApiException("Processor is null in SaxonProcessor.setCatalog");
633 630
        return;
634 631
    }
635 632

  
......
645 642
#ifdef DEBUG
646 643
    SaxonProcessor::sxn_environ->env->ExceptionDescribe();
647 644
#endif
645

  
648 646
}
649 647

  
650 648

  

Also available in: Unified diff