mape / connect-assetmanager

Middleware for Connect (node.js) for handling your static assets.
MIT License
310 stars 48 forks source link

Asset Manager has a bunch of leaked globals #20

Closed dylang closed 9 years ago

dylang commented 12 years ago

Hi Mape - I just used Gleak and found that AssettManager has a bunch of accidental global variables. I think the use of this outside the closure is causing it.

found global leak: tls
found global leak: cacheTimestamps
found global leak: cacheHashes
found global leak: generateCache
found global leak: manipulate
found global leak: getFile
mape commented 12 years ago

Thanks for pointing that out, I'll take a peek at what is causing it.

dsiu commented 12 years ago

any progress on this? 'ret' on global is also leak. it holds the content of the stitched js files.

dsiu commented 12 years ago

upon some peeking, I found the leak is in deps/jsmin.js:364

  jsmin.oldSize = input.length;
  ret = m(input);                        // <---- culprit here
  jsmin.newSize = ret.length;

  return comment + ret;

I will submit a patch

dylang commented 9 years ago

I no longer require this change.