clean up on destruction
Due to statically declared objects, some artifacts aren't removed from /dev/shm when the ipc::chan object is destroyed.
Steps to reproduce: Attached sample code: ipc_plain.cpp.txt
- Place breakpoint at line 35
- Observe contents of /dev/shm: __IPC_SHM____CHUNK_INFO__1383424 (42MBytes) __IPC_SHM____CA_CONN __
The two files are deleted only when main() returns.
Adding diff file here, as the PR on github doesn't show the differences properly: git diff --ignore-space-at-eol src/libipc/ipc.cpp >src/libipc/ipc.cpp.diff.txt ipc.cpp.diff.txt
I will check this out tomorrow.
- about the modification of cc_id_
This is a nice fix, and the connection-info id really doesn't need to worry about global uniqueness.
- about the modification of destroy
'chunk_storages' is a simple memory pool, there is no binding relationship between it and the ipc handle. So if you clean up 'chunk_storages' when an IPC handle is destroyed, you may cause problems for other IPC handles in the same process.