[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [rkward/frameworks] rkward/rbackend: Fix one (unfortunately not the only) crash related to command s
From: Thomas Friedrichsmeier <thomas.friedrichsmeier () ruhr-uni-bochum ! de>
Date: 2016-10-22 20:55:21
Message-ID: E1by3K5-00054t-OI () code ! kde ! org
[Download RAW message or body]
Git commit a987576abb0406b9a8fd92be8e77ac3a177f6b34 by Thomas Friedrichsmeier.
Committed on 22/10/2016 at 20:54.
Pushed by tfry into branch 'frameworks'.
Fix one (unfortunately not the only) crash related to command stack bookkeeping.
M +3 -1 rkward/rbackend/rcommandstack.cpp
http://commits.kde.org/rkward/a987576abb0406b9a8fd92be8e77ac3a177f6b34
diff --git a/rkward/rbackend/rcommandstack.cpp b/rkward/rbackend/rcommandstack.cpp
index 4a7e505..0b7c64c 100644
--- a/rkward/rbackend/rcommandstack.cpp
+++ b/rkward/rbackend/rcommandstack.cpp
@@ -31,6 +31,7 @@ RCommandStack *RCommandStack::regular_stack;
RCommandStack::RCommandStack () : RCommandChain () {
RK_TRACE (RBACKEND);
closed = false;
+ parent = 0;
}
RCommandStack::~RCommandStack () {
@@ -139,6 +140,7 @@ void RCommandStack::pop (RCommandChain *item) {
RK_TRACE (RBACKEND);
RCommandChain *parent = item->parent;
+ RK_DEBUG (RBACKEND, DL_DEBUG, "removing form parent: %s", item->isCommand () ? \
qPrintable (item->toCommand ()->command ()) : "<chain>"); removeFromParent (item);
popIfCompleted (parent);
}
@@ -197,7 +199,6 @@ QModelIndex RCommandStackModel::index (int row, int column, const \
QModelIndex& p RK_TRACE (RBACKEND);
RCommandChain* index_data = 0;
-
if (!parent.isValid ()) {
index_data = RCommandStack::regular_stack;
} else {
@@ -223,6 +224,7 @@ QModelIndex RCommandStackModel::parent (const QModelIndex& child) \
const { RK_ASSERT (child_index);
RCommandChain* index_data = child_index->parent;
+ if (!index_data) return QModelIndex (); // probably the regular_stack
if (index_data) return (createIndex (0, 0, index_data));
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic