[gimp] app: fix error handling in gimp_tool_preset_deserialize_property()



commit 22a95d63a1a169b74590be3c51c1839d5e84b476
Author: Michael Natterer <mitch gimp org>
Date:   Fri Jan 6 03:15:39 2017 +0100

    app: fix error handling in gimp_tool_preset_deserialize_property()
    
    when parsing of an object property fails, we need to set *expected to
    G_TOKEN_NONE to tell the config parser that something has gone wrong,
    or it will continue parsing and run into trouble with the inconsistent
    state (it will try to set an error over the already set error, causing
    a warning).

 app/core/gimptoolpreset.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/app/core/gimptoolpreset.c b/app/core/gimptoolpreset.c
index ee016d3..6649b2f 100644
--- a/app/core/gimptoolpreset.c
+++ b/app/core/gimptoolpreset.c
@@ -437,6 +437,7 @@ gimp_tool_preset_deserialize_property (GimpConfig *config,
                                                                 scanner, 1,
                                                                 NULL))
           {
+            *expected = G_TOKEN_NONE;
             g_object_unref (options);
             break;
           }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]