void GTest_SecStructPredictTask::cleanup()
{
    if (contextAdded) {
        removeContext(resultsTableContextName);
    }

    XmlTest::cleanup();
}
void GTest_UHMM3Search::cleanup() {
    if( cleanuped ) {
        return;
    }
    if( ctxAdded ) {
        removeContext( searchTaskCtxName );
    }
    if( NULL != hmm ) {
        p7_hmm_Destroy( hmm );
    }
    cleanuped = true;
}
void Mission::doBlock( missionNode *node, int mode )
{
    trace( node, mode );
    if (mode == SCRIPT_PARSE)
        scope_stack.push_back( node );
    if (mode == SCRIPT_RUN)
        addContext( node );
    vector< easyDomNode* >::const_iterator siter;
    for (siter = node->subnodes.begin(); siter != node->subnodes.end() && !have_return( mode ); siter++) {
        missionNode *snode = (missionNode*) *siter;
        checkStatement( snode, mode );
    }
    if (mode == SCRIPT_RUN)
        removeContext();
    if (mode == SCRIPT_PARSE)
        scope_stack.pop_back();
}
/*
 * Class:     com_ibm_opencard_terminal_pcsc10_OCFPCSC1
 * Method:    SCardReleaseContext
 * Signature: (I)V
 */
JNIEXPORT void JNICALL Java_com_ibm_opencard_terminal_pcsc10_OCFPCSC1_SCardReleaseContext
(JNIEnv *env, jobject obj, jint context) {

    long returnCode;

    if (isContextAvailable((long)context) < 0) {
        throwPcscException(env, obj, "SCardReleaseContext", "tried to release a non-existing context",0);
        return;
    }

    /* delete the context from the internal table */
    removeContext(context);

    returnCode = SCardReleaseContext((SCARDCONTEXT)context);
    if (returnCode != SCARD_S_SUCCESS) {
        throwPcscException(env, obj, "SCardReleaseContext", "PC/SC Error SCardReleaseContext", returnCode);
        return;
    }
    return;
}
Example #5
0
void ewol::resource::Shader::reload() {
	etk::FSNode file(m_name);
	if (false == file.exist()) {
		EWOL_ERROR("File does not Exist : '" << file << "' : '" << file.getFileSystemName() << "'");
		return;
	}
	
	int64_t fileSize = file.fileSize();
	if (0 == fileSize) {
		EWOL_ERROR("This file is empty : " << file);
		return;
	}
	if (false == file.fileOpenRead()) {
		EWOL_ERROR("Can not open the file : " << file);
		return;
	}
	// remove previous data ...
	if (nullptr != m_fileData) {
		delete[] m_fileData;
		m_fileData = 0;
	}
	// allocate data
	m_fileData = new char[fileSize+5];
	if (nullptr == m_fileData) {
		EWOL_ERROR("Error Memory allocation size=" << fileSize);
		return;
	}
	memset(m_fileData, 0, (fileSize+5)*sizeof(char));
	// load data from the file :
	file.fileRead(m_fileData, 1, fileSize);
	// close the file:
	file.fileClose();
	
	// now change the OGL context ...
	removeContext();
	updateContext();
}
varInst* Mission::doScript( missionNode *node, int mode, varInstMap *varmap )
{
    trace( node, mode );
    if (mode == SCRIPT_PARSE) {
        current_script = node;
        if (parsemode == PARSE_DECL) {
            node->script.name = node->attr_value( "name" );
            if ( node->script.name.empty() )
                fatalError( node, mode, "you have to give a script name" );
            current_module->script.scripts[node->script.name] = node;
            debug( 5, node, mode, "added to module "+current_module->script.name+" : script ="+node->script.name );

            node->script.nr_arguments = 0;

            string retvalue = node->attr_value( "type" );
            if (retvalue.empty() || retvalue == "void")
                node->script.vartype = VAR_VOID;
            else
                node->script.vartype = vartypeFromString( retvalue );
        }
        scope_stack.push_back( node );
    }
    debug( 5, node, mode, "executing script name="+node->script.name );
    if (mode == SCRIPT_RUN) {
        addContextStack( node );
        addContext( node );
    }
    vector< easyDomNode* >::const_iterator siter;
    if (mode == SCRIPT_PARSE && parsemode == PARSE_DECL) {
        node->script.nr_arguments  = 0;
        node->script.argument_node = NULL;
    }
    for (siter = node->subnodes.begin(); siter != node->subnodes.end() && !have_return( mode ); siter++) {
        missionNode *snode = (missionNode*) *siter;
        if (snode->tag == DTAG_ARGUMENTS) {
            doArguments( snode, mode, varmap );
            if (mode == SCRIPT_PARSE && parsemode == PARSE_DECL)
                node->script.argument_node = snode;
            char buffer[200];
            sprintf( buffer, "nr of arguments=%d", node->script.nr_arguments );
            debug( 3, node, mode, buffer );
        } else {
            if (mode == SCRIPT_PARSE && parsemode == PARSE_DECL) {
                //do nothing, break here
            } else {
                checkStatement( snode, mode );
            }
        }
    }
    if (mode == SCRIPT_RUN) {
        removeContext();
        contextStack *cstack = runtime.cur_thread->exec_stack.back();
        varInst *vi = cstack->return_value;
        if (vi != NULL) {
            if (node->script.vartype != vi->type) {
                fatalError( node, mode, "doScript: return type not set correctly" );
                assert( 0 );
            }
        } else
        if (node->script.vartype != VAR_VOID) {
            fatalError( node, mode, "no return set from doScript" );
            assert( 0 );
        }
        varInst *viret = NULL;
        if (vi) {
            viret = newVarInst( VI_TEMP );
            viret->type = vi->type;
            assignVariable( viret, vi );
        }
        removeContextStack();

        return viret;
    } else {
        scope_stack.pop_back();
        return NULL;
    }
}
Example #7
0
ewol::resource::Texture::~Texture() {
	removeContext();
}