[beast: 43/49] BSE: fix undo_stack_to_descriptor() on dummy undo stacks
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast: 43/49] BSE: fix undo_stack_to_descriptor() on dummy undo stacks
- Date: Wed, 1 Jul 2015 11:32:43 +0000 (UTC)
commit 332c86877306e84909268d8fc71a496fda39366e
Author: Tim Janik <timj gnu org>
Date: Thu Jun 25 04:14:48 2015 +0200
BSE: fix undo_stack_to_descriptor() on dummy undo stacks
Dummy undo stacks lack project association, so cannot produce proper object
descriptors. Dummy stacks are used by undoable methods of orphan objects
(usually during destruction), their steps never get executed, so we can
simply resort to a static descriptor which will never be used.
bse/bseundostack.cc | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/bse/bseundostack.cc b/bse/bseundostack.cc
index f43c7c5..e890e1a 100644
--- a/bse/bseundostack.cc
+++ b/bse/bseundostack.cc
@@ -409,6 +409,9 @@ String
undo_stack_to_descriptor (BseUndoStack *ustack, Bse::ItemImpl &item)
{
BseItem *bitem = item.as<BseItem*>();
+ g_return_val_if_fail (bitem != NULL, "");
+ if (IS_DUMMY_USTACK (ustack))
+ return "";
gchar *dp = bse_undo_pointer_pack (bitem, ustack);
String descriptor = dp;
g_free (dp);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]