I have a C program that initiates an MySQL database and then loads GUI with threads, that access the database once at a time.
When I call the
mysql_query() function from the main thread, it works good, but when I call it from a new thread - it crashes on segmentation fault.
This code works fine (MySQL function is called in the main thread):
This code crashes (MySQL function is called in the different thread):
std::thread *my_thread = new std::thread(&MainWindow::updateQueryEngines, this);