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

Removing Unload Library when we Unload NodeJS Loader. It crashes node… #199

Merged
merged 1 commit into from
Apr 5, 2017
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: 0 additions & 2 deletions core/devdoc/node_loader_requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ Unloads the binding module from memory.

**SRS_NODE_MODULE_LOADER_13_008: [** `NodeModuleLoader_Unload` shall do nothing if `moduleLibraryHandle` is `NULL`. **]**

**SRS_NODE_MODULE_LOADER_13_009: [** `NodeModuleLoader_Unload` shall unload the binding module from memory by calling `DynamicLibrary_UnloadLibrary`. **]**

**SRS_NODE_MODULE_LOADER_13_010: [** `NodeModuleLoader_Unload` shall free resources allocated when loading the binding module. **]**

NodeModuleLoader_ParseEntrypointFromJson
Expand Down
3 changes: 0 additions & 3 deletions core/src/module_loaders/node_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,6 @@ static void NodeModuleLoader_Unload(const MODULE_LOADER* loader, MODULE_LIBRARY_
if (moduleLibraryHandle != NULL)
{
NODE_MODULE_HANDLE_DATA* loader_data = moduleLibraryHandle;
//Codes_SRS_NODE_MODULE_LOADER_13_009: [ NodeModuleLoader_Unload shall unload the binding module from memory by calling DynamicLibrary_UnloadLibrary. ]
DynamicLibrary_UnloadLibrary(loader_data->binding_module);

//Codes_SRS_NODE_MODULE_LOADER_13_010: [ NodeModuleLoader_Unload shall free resources allocated when loading the binding module. ]
free(loader_data);
}
Expand Down
2 changes: 0 additions & 2 deletions core/tests/node_loader_ut/node_loader_ut.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,6 @@ TEST_FUNCTION(NodeModuleLoader_Unload_does_nothing_when_moduleLibraryHandle_is_N
ASSERT_ARE_EQUAL(char_ptr, umock_c_get_expected_calls(), umock_c_get_actual_calls());
}

//Tests_SRS_NODE_MODULE_LOADER_13_009: [ NodeModuleLoader_Unload shall unload the binding module from memory by calling DynamicLibrary_UnloadLibrary. ]
//Tests_SRS_NODE_MODULE_LOADER_13_010: [ NodeModuleLoader_Unload shall free resources allocated when loading the binding module. ]
TEST_FUNCTION(NodeModuleLoader_Unload_frees_things)
{
Expand Down Expand Up @@ -667,7 +666,6 @@ TEST_FUNCTION(NodeModuleLoader_Unload_frees_things)

umock_c_reset_all_calls();

STRICT_EXPECTED_CALL(DynamicLibrary_UnloadLibrary((DYNAMIC_LIBRARY_HANDLE)0x42));
STRICT_EXPECTED_CALL(gballoc_free(IGNORED_PTR_ARG))
.IgnoreArgument(1);

Expand Down