239 |
|
int |
240 |
|
RadSimulManager::Cleanup(bool everything) |
241 |
|
{ |
242 |
+ |
if (ray_pnprocs < 0) |
243 |
+ |
return 0; // skip in child process |
244 |
|
NewHeader(); |
245 |
|
if (!ray_pnprocs) |
246 |
|
ray_done(everything); |
290 |
|
int misMatch = rtFlags ^ curFlags; |
291 |
|
// updates based on toggled flags |
292 |
|
if (misMatch & RTtraceSources) { |
293 |
+ |
int sn = nsources; |
294 |
|
if (rtFlags & RTtraceSources) { |
295 |
< |
for (int sn = 0; sn < nsources; sn++) |
295 |
> |
srcFollowed.NewBitMap(nsources); |
296 |
> |
while (sn--) { |
297 |
> |
if (source[sn].sflags & SFOLLOW) |
298 |
> |
continue; |
299 |
|
source[sn].sflags |= SFOLLOW; |
300 |
< |
} else // cannot undo this... |
301 |
< |
rtFlags |= RTtraceSources; |
300 |
> |
srcFollowed.Set(sn); |
301 |
> |
} |
302 |
> |
} else { |
303 |
> |
while (sn--) |
304 |
> |
if (srcFollowed.Check(sn)) |
305 |
> |
source[sn].sflags &= ~SFOLLOW; |
306 |
> |
srcFollowed.NewBitMap(0); |
307 |
> |
} |
308 |
|
} |
309 |
|
if (misMatch & RTdoFIFO && FlushQueue() < 0) |
310 |
|
return false; |