Fixes memory leak on setResourcePath

Thanks Xcode -> Analize
Merge pull request #2 from ricardoquesada/fix_memory_leak

Fixes memory leak on setResourcePath