退出时不需要清理共享内存
This commit is contained in:
parent
9b53fcc68d
commit
80199319f0
|
|
@ -25,14 +25,14 @@ __attribute__((destructor)) void cleanup_shared_memory() {
|
|||
DEBUG_LOG("Log file: %s", LOG_FILE);
|
||||
DEBUG_LOG("Log out file: %s", LOG_OUT_FILE);
|
||||
DEBUG_LOG("Shared memory ID: %d", shm_id);
|
||||
if (shared_config != NULL) {
|
||||
DEBUG_LOG("Cleaning up shared memory.");
|
||||
// Detach shared memory segment
|
||||
if (shmdt(shared_config) == -1) {
|
||||
perror("shmdt failed");
|
||||
}
|
||||
shared_config = NULL;
|
||||
}
|
||||
// if (shared_config != NULL) {
|
||||
// DEBUG_LOG("Cleaning up shared memory.");
|
||||
// // Detach shared memory segment
|
||||
// if (shmdt(shared_config) == -1) {
|
||||
// perror("shmdt failed");
|
||||
// }
|
||||
// shared_config = NULL;
|
||||
// }
|
||||
#ifdef DEBUG
|
||||
// print_stacktrace();
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue