Work on getting rid of trns_chain_finalize().
[pspp] / src / language / data-io / inpt-pgm.c
index b9488f17f47604bcfd92ac9c80c4a79dda9a132c..607196169b1dc1ca3c7ec7f7d9e922dc1e7b4392 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 1997-9, 2000, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
+   Copyright (C) 1997-9, 2000, 2009, 2010, 2011, 2012, 2013, 2015 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -22,6 +22,7 @@
 #include "data/case.h"
 #include "data/caseinit.h"
 #include "data/casereader-provider.h"
+#include "data/control-stack.h"
 #include "data/dataset.h"
 #include "data/dictionary.h"
 #include "data/session.h"
@@ -154,8 +155,8 @@ cmd_input_program (struct lexer *lexer, struct dataset *ds)
       return CMD_FAILURE;
     }
 
-  inp->trns_chain = proc_capture_transformations (inp->ds);
-  trns_chain_finalize (inp->trns_chain);
+  ctl_stack_clear ();
+  inp->trns_chain = proc_capture_transformations (ds);
 
   inp->restart = TRNS_CONTINUE;
 
@@ -230,6 +231,7 @@ destroy_input_program (struct input_program_pgm *pgm)
   if (pgm != NULL)
     {
       session_destroy (pgm->session);
+      ctl_stack_clear ();
       trns_chain_destroy (pgm->trns_chain);
       caseinit_destroy (pgm->init);
       caseproto_unref (pgm->proto);