Orange: fix for threaded rendering. Discovered that for some reason the
authorTon Roosendaal <ton@blender.org>
Sat, 28 Jan 2006 10:30:16 +0000 (10:30 +0000)
committerTon Roosendaal <ton@blender.org>
Sat, 28 Jan 2006 10:30:16 +0000 (10:30 +0000)
commit80bd3a1e9897044334d3384be27b52efc6541fef
treee3b29473cd7f7081c2d89e59eaef04aff646a41e
parentbb2e2b9ec86efd889d648ddd62cddf5849273654
Orange: fix for threaded rendering. Discovered that for some reason the
threads didn't seem to free allocated memory... while rendering an long
sequence, the 'virtual memory' size grew with about 20 meg per frame.
This appeared to be not related to using malloc in threads (works
properly), but just because threads were not closed properly.

I assumed that the call to SDL_CreateThread() also closes the thread
when finished... but that seems to be not the case. By using a call to
SDL_WaitThread() after the thread was finished the memory heap is stable
again.

This is something I've seen not documented anywhere... the SDL man
pages are horrible sparse; Take for example the official page:

http://manuals.thexdershome.com/SDL-1.2.5/html/sdlcreatethread.html
source/blender/render/intern/source/pipeline.c