* ResetCancelConn * * Free the current cancel connection, if any, and set to NULL. */
| 104 | * Free the current cancel connection, if any, and set to NULL. |
| 105 | */ |
| 106 | void |
| 107 | ResetCancelConn(void) |
| 108 | { |
| 109 | PGcancel *oldCancelConn; |
| 110 | |
| 111 | #ifdef WIN32 |
| 112 | EnterCriticalSection(&cancelConnLock); |
| 113 | #endif |
| 114 | |
| 115 | oldCancelConn = cancelConn; |
| 116 | |
| 117 | /* be sure handle_sigint doesn't use pointer while freeing */ |
| 118 | cancelConn = NULL; |
| 119 | |
| 120 | if (oldCancelConn != NULL) |
| 121 | PQfreeCancel(oldCancelConn); |
| 122 | |
| 123 | #ifdef WIN32 |
| 124 | LeaveCriticalSection(&cancelConnLock); |
| 125 | #endif |
| 126 | } |
| 127 | |
| 128 | |
| 129 | /* |
no test coverage detected