---
name: "mysql_thread_end"
section: "3"
platform: "linux"
package: "mariadb"
version: "13.0.2-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/mysql_thread_end"
---

# mysql\_thread\_end(3)

### Name

mysql\_thread\_end - Releases thread specific memory

### Synopsis

-

  ```
  #include <mysql.h>
  void mysql_thread_end(void );
  ```

### Description

The mysql\_thread\_end() function needs to be called before a client thread ends. It will release thread specific memory, which was allocated by a previous **[mysql\_thread\_init(3)](/mysql_thread_init/3.md)** call. Returns void.

### Notes

Unlike **[mysql\_thread\_init(3)](/mysql_thread_init/3.md)** mysql\_thread\_end() will not be invoked automatically if the thread ends. To avoid memory leaks mysql\_thread\_end() must be called explicitly.

### History

This function is deprecated since MariaDB Connector/C 3.0.0.

### See also

- •

  **[mysql\_thread\_init(3)](/mysql_thread_init/3.md)**

- •

  **mysql\_thread\_safe(3)**
