mirror of https://github.com/KLayout/klayout.git
More safeguards against crashes in the absence of a Manager object
This commit is contained in:
parent
f7ef538f34
commit
682cc0e491
|
|
@ -339,7 +339,7 @@ public:
|
||||||
|
|
||||||
void open ()
|
void open ()
|
||||||
{
|
{
|
||||||
if (! mp_manager->transacting ()) {
|
if (mp_manager && ! mp_manager->transacting ()) {
|
||||||
mp_manager->transaction (m_description, m_transaction_id);
|
mp_manager->transaction (m_description, m_transaction_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,9 @@ Editables::del (db::Transaction *transaction)
|
||||||
cancel_edits ();
|
cancel_edits ();
|
||||||
|
|
||||||
// this dummy operation will update the screen:
|
// this dummy operation will update the screen:
|
||||||
manager ()->queue (this, new db::Op ());
|
if (manager ()) {
|
||||||
|
manager ()->queue (this, new db::Op ());
|
||||||
|
}
|
||||||
|
|
||||||
for (iterator e = begin (); e != end (); ++e) {
|
for (iterator e = begin (); e != end (); ++e) {
|
||||||
e->del ();
|
e->del ();
|
||||||
|
|
@ -129,7 +131,9 @@ Editables::cut ()
|
||||||
cancel_edits ();
|
cancel_edits ();
|
||||||
|
|
||||||
// this dummy operation will update the screen:
|
// this dummy operation will update the screen:
|
||||||
manager ()->queue (this, new db::Op ());
|
if (manager ()) {
|
||||||
|
manager ()->queue (this, new db::Op ());
|
||||||
|
}
|
||||||
|
|
||||||
db::Clipboard::instance ().clear ();
|
db::Clipboard::instance ().clear ();
|
||||||
for (iterator e = begin (); e != end (); ++e) {
|
for (iterator e = begin (); e != end (); ++e) {
|
||||||
|
|
@ -186,7 +190,9 @@ Editables::transform (const db::DCplxTrans &t, db::Transaction *transaction)
|
||||||
trans_holder->open ();
|
trans_holder->open ();
|
||||||
|
|
||||||
// this dummy operation will update the screen:
|
// this dummy operation will update the screen:
|
||||||
manager ()->queue (this, new db::Op ());
|
if (manager ()) {
|
||||||
|
manager ()->queue (this, new db::Op ());
|
||||||
|
}
|
||||||
|
|
||||||
for (iterator e = begin (); e != end (); ++e) {
|
for (iterator e = begin (); e != end (); ++e) {
|
||||||
e->transform (t);
|
e->transform (t);
|
||||||
|
|
@ -208,7 +214,7 @@ Editables::paste ()
|
||||||
cancel_edits ();
|
cancel_edits ();
|
||||||
|
|
||||||
// this dummy operation will update the screen:
|
// this dummy operation will update the screen:
|
||||||
if (manager ()->transacting ()) {
|
if (manager () && manager ()->transacting ()) {
|
||||||
manager ()->queue (this, new db::Op ());
|
manager ()->queue (this, new db::Op ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -610,7 +616,9 @@ Editables::end_move (const db::DPoint &p, lay::angle_constraint_type ac, db::Tra
|
||||||
trans_holder->open ();
|
trans_holder->open ();
|
||||||
|
|
||||||
// this dummy operation will update the screen:
|
// this dummy operation will update the screen:
|
||||||
manager ()->queue (this, new db::Op ());
|
if (manager ()) {
|
||||||
|
manager ()->queue (this, new db::Op ());
|
||||||
|
}
|
||||||
|
|
||||||
for (iterator e = begin (); e != end (); ++e) {
|
for (iterator e = begin (); e != end (); ++e) {
|
||||||
e->end_move (p, ac);
|
e->end_move (p, ac);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue