Skip to content

Commit

Permalink
addon: clear dlerror before dlopen
Browse files Browse the repository at this point in the history
  • Loading branch information
eilvelia committed Sep 21, 2023
1 parent 876bab9 commit f32d94d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/tdl/addon/td.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ void load_tdjson(const Napi::CallbackInfo& info) {
Napi::Env env = info.Env();
std::string library_file_str = info[0].As<Napi::String>().Utf8Value();
const char *library_file = library_file_str.c_str();
dlerror(); // Clear errors
void *handle = DLOPEN(library_file)
if (handle == NULL) {
char *dlerror_message = dlerror();
Expand Down

0 comments on commit f32d94d

Please sign in to comment.