#include "commands/trigger.h"
#include "executor/execdebug.h"
#include "foreign/fdwapi.h"
-#include "jit/jit.h"
#include "mb/pg_wchar.h"
#include "miscadmin.h"
#include "optimizer/clauses.h"
UnregisterSnapshot(estate->es_snapshot);
UnregisterSnapshot(estate->es_crosscheck_snapshot);
- /* release JIT context, if allocated */
- if (estate->es_jit)
- jit_release_context(estate->es_jit);
-
/*
* Must switch out of context before destroying it
*/
#include "access/relscan.h"
#include "access/transam.h"
#include "executor/executor.h"
+#include "jit/jit.h"
#include "mb/pg_wchar.h"
#include "nodes/nodeFuncs.h"
#include "parser/parsetree.h"
*
* Release an EState along with all remaining working storage.
*
- * Note: this is not responsible for releasing non-memory resources,
- * such as open relations or buffer pins. But it will shut down any
- * still-active ExprContexts within the EState. That is sufficient
- * cleanup for situations where the EState has only been used for expression
- * evaluation, and not to run a complete Plan.
+ * Note: this is not responsible for releasing non-memory resources, such as
+ * open relations or buffer pins. But it will shut down any still-active
+ * ExprContexts within the EState and deallocate associated JITed expressions.
+ * That is sufficient cleanup for situations where the EState has only been
+ * used for expression evaluation, and not to run a complete Plan.
*
* This can be called in any memory context ... so long as it's not one
* of the ones to be freed.
/* FreeExprContext removed the list link for us */
}
+ /* release JIT context, if allocated */
+ if (estate->es_jit)
+ {
+ jit_release_context(estate->es_jit);
+ estate->es_jit = NULL;
+ }
+
/*
* Free the per-query memory context, thereby releasing all working
* memory, including the EState node itself.