| 132 | |
| 133 | |
| 134 | void fconfig_deleteinstance(CriticalSection *mutex) |
| 135 | { |
| 136 | if(fconfig_instance != NULL) |
| 137 | { |
| 138 | CriticalSection::SafeLock l(mutex ? *mutex : fcmutex, false); |
| 139 | if(fconfig_instance != NULL) |
| 140 | { |
| 141 | #if FCONFIG_USESHM == 1 |
| 142 | |
| 143 | shmdt((char *)fconfig_instance); |
| 144 | if(fconfig_shmid != -1) |
| 145 | { |
| 146 | int ret = shmctl(fconfig_shmid, IPC_RMID, 0); |
| 147 | char *env = NULL; |
| 148 | if((env = getenv("VGL_VERBOSE")) != NULL && strlen(env) > 0 |
| 149 | && !strncmp(env, "1", 1) && ret != -1) |
| 150 | vglout.println("[VGL] Removed shared memory segment %d", |
| 151 | fconfig_shmid); |
| 152 | } |
| 153 | |
| 154 | #else |
| 155 | |
| 156 | delete fconfig_instance; |
| 157 | |
| 158 | #endif |
| 159 | |
| 160 | fconfig_instance = NULL; |
| 161 | } |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | |
| 166 | static void fconfig_init(void) |
no test coverage detected