Skip to content

Commit 4e30cee

Browse files
code refactor
1 parent 0c5046b commit 4e30cee

3 files changed

Lines changed: 2 additions & 31 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
- name: Build
5454
run: |
5555
rm -rf build
56-
cmake -B build . -G Ninja -DCMAKE_BUILD_TYPE=Debug -DENABLE_TESTS=ON -DENABLE_ASAN=ON -DBUILD_EXECUTABLE=OFF
56+
cmake -B build . -G Ninja -DCMAKE_BUILD_TYPE=Debug -DENABLE_TESTS=ON -DENABLE_ASAN=OFF -DBUILD_EXECUTABLE=OFF
5757
cmake --build build
5858
cd build && ctest --output-on-failure --verbose
5959

include/bitchat/services/noise_service.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@ class NoiseService
2424
{
2525
public:
2626
NoiseService();
27-
~NoiseService();
28-
29-
// Cleanup method
30-
void cleanup();
27+
~NoiseService() = default;
3128

3229
// Session management
3330
std::shared_ptr<NoiseSession> createSession(const std::string &peerID, NoiseRole role);

src/bitchat/services/noise_service.cpp

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
#include "bitchat/core/constants.h"
33
#include "bitchat/helpers/noise_helper.h"
44
#include "bitchat/noise/noise_session_default.h"
5-
#include <openssl/err.h>
6-
#include <openssl/evp.h>
75
#include <openssl/rand.h>
86
#include <spdlog/spdlog.h>
97

@@ -18,30 +16,6 @@ NoiseService::NoiseService()
1816
}
1917
}
2018

21-
NoiseService::~NoiseService()
22-
{
23-
cleanup();
24-
}
25-
26-
void NoiseService::cleanup()
27-
{
28-
std::lock_guard<std::mutex> lock(sessionsMutex);
29-
30-
// Clear all sessions
31-
sessions.clear();
32-
33-
// Clear OpenSSL
34-
CRYPTO_set_locking_callback(nullptr);
35-
CRYPTO_set_id_callback(nullptr);
36-
37-
ERR_remove_state(0);
38-
39-
ERR_free_strings();
40-
EVP_cleanup();
41-
42-
CRYPTO_cleanup_all_ex_data();
43-
}
44-
4519
std::shared_ptr<NoiseSession> NoiseService::createSession(const std::string &peerID, NoiseRole role)
4620
{
4721
std::lock_guard<std::mutex> lock(sessionsMutex);

0 commit comments

Comments
 (0)