shmaplib cleanup