mirror of https://github.com/KLayout/klayout.git
Merge pull request #256 from KLayout/issue-251
Fixed #251 - exit handler missing? [skip ci]
This commit is contained in:
commit
a1bac382dc
|
|
@ -390,6 +390,30 @@ sm_assign (const char *name, const gsi::ClassBase *cls)
|
||||||
return sm;
|
return sm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const std::set<std::pair<std::string, bool> > &name_map_for_class (const gsi::ClassBase *cls, std::map<const gsi::ClassBase *, std::set<std::pair<std::string, bool> > > &cache)
|
||||||
|
{
|
||||||
|
if (! cls) {
|
||||||
|
static std::set<std::pair<std::string, bool> > empty;
|
||||||
|
return empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::map<const gsi::ClassBase *, std::set<std::pair<std::string, bool> > >::iterator cc = cache.find (cls);
|
||||||
|
if (cc != cache.end ()) {
|
||||||
|
return cc->second;
|
||||||
|
}
|
||||||
|
|
||||||
|
cc = cache.insert (std::make_pair ((const gsi::ClassBase *) 0, std::set<std::pair<std::string, bool> > ())).first;
|
||||||
|
cc->second = name_map_for_class (cls->base (), cache);
|
||||||
|
|
||||||
|
for (gsi::ClassBase::method_iterator m = cls->begin_methods (); m != cls->end_methods (); ++m) {
|
||||||
|
for (gsi::MethodBase::synonym_iterator syn = (*m)->begin_synonyms (); syn != (*m)->end_synonyms (); ++syn) {
|
||||||
|
cc->second.insert (std::make_pair (syn->name, (*m)->is_static ()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return cc->second;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ClassBase::merge_declarations ()
|
ClassBase::merge_declarations ()
|
||||||
{
|
{
|
||||||
|
|
@ -433,6 +457,8 @@ ClassBase::merge_declarations ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::map<const gsi::ClassBase *, std::set<std::pair<std::string, bool> > > name_maps;
|
||||||
|
|
||||||
// Add to the classes the special methods and clean up the method table
|
// Add to the classes the special methods and clean up the method table
|
||||||
for (gsi::ClassBase::class_iterator c = gsi::ClassBase::begin_new_classes (); c != gsi::ClassBase::end_new_classes (); ++c) {
|
for (gsi::ClassBase::class_iterator c = gsi::ClassBase::begin_new_classes (); c != gsi::ClassBase::end_new_classes (); ++c) {
|
||||||
|
|
||||||
|
|
@ -441,12 +467,7 @@ ClassBase::merge_declarations ()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::set<std::pair<std::string, bool> > name_map;
|
const std::set<std::pair<std::string, bool> > &name_map = name_map_for_class (c.operator-> (), name_maps);
|
||||||
for (gsi::ClassBase::method_iterator m = c->begin_methods (); m != c->end_methods (); ++m) {
|
|
||||||
for (gsi::MethodBase::synonym_iterator syn = (*m)->begin_synonyms (); syn != (*m)->end_synonyms (); ++syn) {
|
|
||||||
name_map.insert (std::make_pair (syn->name, (*m)->is_static ()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// We don't want the declaration object to be non-const except for this case. So
|
// We don't want the declaration object to be non-const except for this case. So
|
||||||
// we const_cast here.
|
// we const_cast here.
|
||||||
|
|
|
||||||
|
|
@ -689,6 +689,14 @@ MainWindow::MainWindow (QApplication *app, lay::Plugin *plugin_parent, const cha
|
||||||
|
|
||||||
MainWindow::~MainWindow ()
|
MainWindow::~MainWindow ()
|
||||||
{
|
{
|
||||||
|
// avoid deferred execution later on where there isn't a valid main window anymore
|
||||||
|
// (problem case: showing a dialog inside main windows's destroyed signal - this will
|
||||||
|
// process events and trigger execution if not disabled)
|
||||||
|
if (! tl::DeferredMethodScheduler::instance ()->is_disabled ()) {
|
||||||
|
tl::DeferredMethodScheduler::instance ()->execute ();
|
||||||
|
}
|
||||||
|
tl::DeferredMethodScheduler::instance ()->enable (false);
|
||||||
|
|
||||||
lay::register_help_handler (0, 0);
|
lay::register_help_handler (0, 0);
|
||||||
|
|
||||||
// since the configuration actions unregister themselves, we need to do this before the main
|
// since the configuration actions unregister themselves, we need to do this before the main
|
||||||
|
|
|
||||||
|
|
@ -180,12 +180,12 @@ inline void rb_protect_init ()
|
||||||
|
|
||||||
#define RUBY_BEGIN_EXEC \
|
#define RUBY_BEGIN_EXEC \
|
||||||
try { \
|
try { \
|
||||||
rba::RubyInterpreter::instance()->begin_exec ();
|
if (rba::RubyInterpreter::instance ()) { rba::RubyInterpreter::instance ()->begin_exec (); }
|
||||||
|
|
||||||
#define RUBY_END_EXEC \
|
#define RUBY_END_EXEC \
|
||||||
rba::RubyInterpreter::instance()->end_exec (); \
|
if (rba::RubyInterpreter::instance ()) { rba::RubyInterpreter::instance()->end_exec (); } \
|
||||||
} catch (...) { \
|
} catch (...) { \
|
||||||
rba::RubyInterpreter::instance()->end_exec (); \
|
if (rba::RubyInterpreter::instance ()) { rba::RubyInterpreter::instance()->end_exec (); } \
|
||||||
throw; \
|
throw; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue