Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix memory leak by calling H5close() in NDFileHDF5::closeFile() #390

Merged
merged 4 commits into from
Mar 28, 2019
Merged
Changes from 1 commit
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
10 changes: 10 additions & 0 deletions ADApp/pluginSrc/NDFileHDF5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1658,10 +1658,20 @@ asynStatus NDFileHDF5::closeFile()
"%s::%s Closing file not totally clean. Attributes remaining=%d\n",
driverName, functionName, obj_count);
}
obj_count = (int)H5Fget_obj_count(this->file, H5F_OBJ_ALL);
if (obj_count > 0){
asynPrint(this->pasynUserSelf, ASYN_TRACE_ERROR,
hinxx marked this conversation as resolved.
Show resolved Hide resolved
"%s::%s Closing file not totally clean. All remaining=%d\n",
driverName, functionName, obj_count);
}

// Close the HDF file
H5Fclose(this->file);
this->file = 0;
// Flush all data to disk, close all open HDF5 objects,
// and clean up all memory used by the HDF5 library
// to avoid memory leaks
H5close();

// At this point we can clear the SWMR active flag, whether we were running
// in SWMR mode or not
Expand Down