wowserhq / wowser

World of Warcraft in the browser using JavaScript and WebGL
MIT License
241 stars 63 forks source link

Pipeline: Fix resource leak #88

Closed fallenoak closed 8 years ago

fallenoak commented 8 years ago

After the pipeline server responds to a request, there's no call to close() on req.resource, which is a File from blizzardry/src/lib/mpq/file.js.

I believe close() is necessary to get StormLib to free up its handle on the file loaded out of the MPQ.

Adding close() appears to keep the pipeline server from bloating into the multi-GB range for memory usage after extended sessions in Wowser. With the fix, I've been able to observe memory usage going down after a period of time--which never seemed to happen before.

fallenoak commented 8 years ago

Woops, forgot to branch this off of the right location. Closing and fixing!