Changeset d5d6e31 in tol for toltcl


Ignore:
Timestamp:
Nov 4, 2011, 2:08:47 PM (15 years ago)
Author:
Jorge Pérez <josp.jorge@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
08e78b9
Parents:
b3eeebe
Message:

refs #1323, make sure InitTolKernel is invoked only if TOL has not being initialized

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@3793 be4846ae-f051-483a-831f-b64e7d08527f

Location:
toltcl/generic
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • toltcl/generic/tolaccess.cpp

    rb3eeebe rd5d6e31  
    142142  }
    143143  return TCL_OK;
     144}
     145
     146int Tol_IsInitialized( )
     147{
     148  return BGrammar::Exists( "Real" );
    144149}
    145150
  • toltcl/generic/toltcl.c

    rb3eeebe rd5d6e31  
    217217  lang = (objc == 1 || !strcasecmp("es", Tcl_GetString(objv[1])));
    218218  vmode = objc == 3 ? Tcl_GetString(objv[2]) :  NULL;
    219   /*
    220    * Initialize kernel
    221    */
    222 
    223   InitTolKernel(Tcl_GetNameOfExecutable(), lang, vmode&&vmode[0]?vmode:NULL);
    224 
    225   /*
    226    * this should only be called to find out where the GSL errors are generated
    227    */
    228 
    229   Tol_gsl_set_error_handler(&TT_gsl_error_handler);
    230 
     219
     220  if ( !Tol_IsInitialized( ) ) {
     221    //printf( "TOL no esta inicializado\n" );
     222    /*
     223     * Initialize kernel
     224     */
     225   
     226    InitTolKernel(Tcl_GetNameOfExecutable(), lang, vmode&&vmode[0]?vmode:NULL);
     227   
     228    /*
     229     * this should only be called to find out where the GSL errors are generated
     230     */
     231   
     232    Tol_gsl_set_error_handler(&TT_gsl_error_handler);
     233  } else {
     234    //printf( "TOL esta inicializado\n" );
     235  }
     236 
    231237  /*
    232238   * Install tol::* commands
  • toltcl/generic/toltclInt.h

    rb3eeebe rd5d6e31  
    3939#endif
    4040
    41 
    4241BEGIN_C_DECLS
    4342
    44 
    4543extern Tcl_Interp * TT_interp;
     44
     45/*! Check if TOL kernel has being initialized
     46 */
     47extern int Tol_IsInitialized ();
    4648
    4749/*! Fill in obj_result the version info corresponding to tol
Note: See TracChangeset for help on using the changeset viewer.