From a3b6083a794af4e708aace363e48be3b1c06359b Mon Sep 17 00:00:00 2001 From: Ziad Arafat Date: Wed, 6 Oct 2021 11:04:14 -0600 Subject: [PATCH] fixed shared memory not deleting --- Program2/witharray_shm/witharray_shm.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Program2/witharray_shm/witharray_shm.c b/Program2/witharray_shm/witharray_shm.c index 7f5563c..748fc93 100644 --- a/Program2/witharray_shm/witharray_shm.c +++ b/Program2/witharray_shm/witharray_shm.c @@ -21,6 +21,11 @@ Changelog - Added shared memory dynamically allocated array for results - BUGFIX: array was not actually shared because i was using malloc instaed of using the shared memory get method to allocate + +10/06 +- Fixed thread so it has its own array +- BUGFIX: Shared memory was not going away because I wasnt calling shmctl I +mistakenly tought shmdt was all I needed. - */ @@ -214,6 +219,8 @@ int main(int argc, char const *argv[]) exit(-1); } + shmctl(shmid, IPC_RMID, NULL); + return 0; }