Frees the resources of a ExprEvalState heap object. * This should only be used on an ExprEvalState created on the same memory context using the * GetExpressionEvalState* functions. */
| 358 | * This should only be used on an ExprEvalState created on the same memory context using the |
| 359 | * GetExpressionEvalState* functions. */ |
| 360 | void |
| 361 | FreeExprEvalState(ExprEvalState *exprEvalState, MemoryContext memoryContext) |
| 362 | { |
| 363 | if (exprEvalState != NULL) |
| 364 | { |
| 365 | MemoryContext originalMemoryContext = MemoryContextSwitchTo(memoryContext); |
| 366 | |
| 367 | if (exprEvalState->estate != NULL) |
| 368 | { |
| 369 | /* this will destroy the executor state memory context which holds exprState and exprContext. */ |
| 370 | FreeExecutorState(exprEvalState->estate); |
| 371 | exprEvalState->estate = NULL; |
| 372 | } |
| 373 | |
| 374 | if (exprEvalState->datums != NULL) |
| 375 | { |
| 376 | pfree(exprEvalState->datums); |
| 377 | exprEvalState->datums = NULL; |
| 378 | } |
| 379 | |
| 380 | if (exprEvalState->tupleSlot != NULL) |
| 381 | { |
| 382 | ExecDropSingleTupleTableSlot(exprEvalState->tupleSlot); |
| 383 | exprEvalState->tupleSlot = NULL; |
| 384 | } |
| 385 | |
| 386 | pfree(exprEvalState); |
| 387 | |
| 388 | MemoryContextSwitchTo(originalMemoryContext); |
| 389 | } |
| 390 | } |
| 391 | |
| 392 | |
| 393 | /* --------------------------------------------------------- */ |
no outgoing calls
no test coverage detected