Skip to content

Commit

Permalink
Removed all memory leaks and heap corruption
Browse files Browse the repository at this point in the history
  • Loading branch information
FredyH committed Nov 7, 2021
1 parent c36c467 commit f08ccdf
Show file tree
Hide file tree
Showing 21 changed files with 278 additions and 273 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ add_subdirectory(GmodLUA)

file(GLOB_RECURSE MYSQLOO_SRC "src/*.h" "src/*.cpp")
set(SOURCE_FILES ${MYSQLOO_SRC} src/Main.cpp)
set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_BUILD_TYPE Release)

add_library(mysqloo SHARED ${SOURCE_FILES})
target_link_libraries(mysqloo gmod-module-base)
Expand Down
2 changes: 1 addition & 1 deletion MySQLOO/include/Database.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Database : public LuaObjectBase {
void freeStatement(MYSQL_STMT* stmt);
void enqueueQuery(IQuery* query, std::shared_ptr<IQueryData> data);
void think(GarrysMod::Lua::ILuaBase*);
void setAutoReconnect(bool autoReconnect);
void setSQLAutoReconnect(bool autoReconnect);
bool getAutoReconnect();
bool shouldCachePreparedStatements() {
return cachePreparedStatements;
Expand Down
2 changes: 1 addition & 1 deletion src/BlockingQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class BlockingQueue {

void remove(T elem) {
std::lock_guard<std::recursive_mutex> lock(mutex);
backingQueue.erase(std::remove(backingQueue.begin(), backingQueue.end(), elem));
backingQueue.erase(std::remove(backingQueue.begin(), backingQueue.end(), elem), backingQueue.end());
}

size_t size() {
Expand Down
Loading

0 comments on commit f08ccdf

Please sign in to comment.