mirror of https://github.com/KLayout/klayout.git
For strmxor unit tests: gsi initialization fixed
Now the gsi::initialize_expressions includes gsi::initialize. Both can be called multiple times (the second time they are ignored).
This commit is contained in:
parent
1baddd3632
commit
f013f1541e
|
|
@ -35,6 +35,13 @@ namespace gsi
|
||||||
void GSI_PUBLIC
|
void GSI_PUBLIC
|
||||||
initialize ()
|
initialize ()
|
||||||
{
|
{
|
||||||
|
// Allow duplicate initialization without any effect
|
||||||
|
static bool s_is_initialized = false;
|
||||||
|
if (s_is_initialized) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
s_is_initialized = true;
|
||||||
|
|
||||||
tl::SelfTimer timer (tl::verbosity () >= 21, "Initializing script environment");
|
tl::SelfTimer timer (tl::verbosity () >= 21, "Initializing script environment");
|
||||||
|
|
||||||
for (gsi::ClassBase::class_iterator c = gsi::ClassBase::begin_classes (); c != gsi::ClassBase::end_classes (); ++c) {
|
for (gsi::ClassBase::class_iterator c = gsi::ClassBase::begin_classes (); c != gsi::ClassBase::end_classes (); ++c) {
|
||||||
|
|
|
||||||
|
|
@ -1073,6 +1073,15 @@ private:
|
||||||
void GSI_PUBLIC
|
void GSI_PUBLIC
|
||||||
initialize_expressions ()
|
initialize_expressions ()
|
||||||
{
|
{
|
||||||
|
// Allow duplicate initialization without any effect
|
||||||
|
static bool s_is_initialized = false;
|
||||||
|
if (s_is_initialized) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
s_is_initialized = true;
|
||||||
|
|
||||||
|
gsi::initialize ();
|
||||||
|
|
||||||
for (gsi::ClassBase::class_iterator c = gsi::ClassBase::begin_classes (); c != gsi::ClassBase::end_classes (); ++c) {
|
for (gsi::ClassBase::class_iterator c = gsi::ClassBase::begin_classes (); c != gsi::ClassBase::end_classes (); ++c) {
|
||||||
|
|
||||||
// install the method table:
|
// install the method table:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue