Do you have any QSqlQuery objects alive when you try to remove the connection? If you have, then that would cause the warning.