correctly handle gc with UndoManager and un-merge when syncing

This commit is contained in:
Kevin Jahns
2018-04-23 13:25:30 +02:00
parent ef6eb08335
commit 94933a704d
10 changed files with 38 additions and 15 deletions

View File

@@ -214,7 +214,10 @@ export default class Type extends Item {
* @param {boolean} createDelete Whether to propagate a message that this
* Type was deleted.
*/
_delete (y, createDelete, gcChildren = true) {
_delete (y, createDelete, gcChildren) {
if (gcChildren === undefined) {
gcChildren = y._hasUndoManager === false
}
super._delete(y, createDelete, gcChildren)
y._transaction.changedTypes.delete(this)
// delete map types