Reference counter based cleanup of resources.
Merge remote-tracking branch 'origin/master'