mirror of https://github.com/KLayout/klayout.git
Checking some pointers for null (maybe responsible for crashes during PCell development)
This commit is contained in:
parent
acbbd92194
commit
7146db4762
|
|
@ -2872,15 +2872,18 @@ Layout::get_context_info (cell_index_type cell_index, LayoutOrCellContextInfo &i
|
|||
if (pcell_variant) {
|
||||
|
||||
const db::PCellDeclaration *pcell_decl = ly->pcell_declaration (pcell_variant->pcell_id ());
|
||||
|
||||
const std::vector<db::PCellParameterDeclaration> &pcp = pcell_decl->parameter_declarations ();
|
||||
std::vector<db::PCellParameterDeclaration>::const_iterator pd = pcp.begin ();
|
||||
for (std::vector<tl::Variant>::const_iterator p = pcell_variant->parameters ().begin (); p != pcell_variant->parameters ().end () && pd != pcp.end (); ++p, ++pd) {
|
||||
info.pcell_parameters.insert (std::make_pair (pd->get_name (), *p));
|
||||
if (pcell_decl) {
|
||||
const std::vector<db::PCellParameterDeclaration> &pcp = pcell_decl->parameter_declarations ();
|
||||
std::vector<db::PCellParameterDeclaration>::const_iterator pd = pcp.begin ();
|
||||
for (std::vector<tl::Variant>::const_iterator p = pcell_variant->parameters ().begin (); p != pcell_variant->parameters ().end () && pd != pcp.end (); ++p, ++pd) {
|
||||
info.pcell_parameters.insert (std::make_pair (pd->get_name (), *p));
|
||||
}
|
||||
}
|
||||
|
||||
const db::PCellHeader *header = ly->pcell_header (pcell_variant->pcell_id ());
|
||||
info.pcell_name = header->get_name ();
|
||||
if (header) {
|
||||
info.pcell_name = header->get_name ();
|
||||
}
|
||||
|
||||
} else if (ly != this) {
|
||||
info.cell_name = ly->cell_name (cptr->cell_index ());
|
||||
|
|
|
|||
|
|
@ -3468,8 +3468,9 @@ MacroEditorDialog::leave_breakpoint_mode ()
|
|||
set_exec_point (0, -1, -1);
|
||||
|
||||
// refresh UI that might have been spoiled because we filter events
|
||||
if (lay::MainWindow::instance ()) {
|
||||
lay::MainWindow::instance ()->update ();
|
||||
auto tl_widgets = QApplication::topLevelWidgets ();
|
||||
for (auto w = tl_widgets.begin (); w != tl_widgets.end (); ++w) {
|
||||
(*w)->update ();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue