Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[v1.9.x] stop closing opened libs #20523

Merged
merged 3 commits into from
Aug 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/mxnet/c_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ MXNET_DLL const char *MXGetLastError();
/*!
* \brief Load library dynamically
* \param path to the library .so file
* \param 0 for quiet, 1 for verbose
* \param verbose 0 for quiet, 1 for verbose
* \return 0 when success, -1 when failure happens.
*/
MXNET_DLL int MXLoadLib(const char *path, unsigned verbose);
Expand Down
2 changes: 1 addition & 1 deletion python/mxnet/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def load(path, verbose=True):

Returns
---------
void
None
"""
#check if path exists
if not os.path.exists(path):
Expand Down
2 changes: 2 additions & 0 deletions src/c_api/c_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1514,6 +1514,8 @@ void registerPasses(void *lib, int verbose, mxnet::ext::msgSize_t msgSize,
/*!
* \brief Loads dynamic custom library and initializes it
* \param path library path
* \param verbose 0 for quiet, 1 for verbose
* \return 0 when success, -1 when failure happens.
*/
int MXLoadLib(const char *path, unsigned verbose) {
API_BEGIN();
Expand Down
4 changes: 0 additions & 4 deletions src/initialize.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,6 @@ LibraryInitializer::LibraryInitializer()
install_pthread_atfork_handlers();
}

LibraryInitializer::~LibraryInitializer() {
close_open_libs();
}

bool LibraryInitializer::lib_is_loaded(const std::string& path) const {
return loaded_libs.count(path) > 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/initialize.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class LibraryInitializer {
*/
LibraryInitializer();

~LibraryInitializer();
~LibraryInitializer() = default;

/**
* @return true if the current pid doesn't match the one that initialized the library
Expand Down