ui/common/context.c

changeset 131
774b741984a2
parent 128
c284c15509a8
child 140
c03c338a7dcf
--- a/ui/common/context.c	Sun Sep 18 07:45:42 2016 +0200
+++ b/ui/common/context.c	Sun Sep 18 08:39:37 2016 +0200
@@ -61,6 +61,10 @@
 }
 
 void uic_context_set_document(UiContext *ctx, void *document) {
+    if(ctx->document == document) {
+        return;
+    }
+    
     UiContext *docctx = ui_document_context(document);
     if(!docctx) {
         return;
@@ -228,6 +232,10 @@
             } else {
                 f->value = f->get(f);
                 f->pos = f->position(f);
+                f->set = NULL;
+                f->get = NULL;
+                f->setposition = NULL;
+                f->position = NULL;
             }
             break;
         }

mercurial