Revert "corrected memory leak when renaming scripts within object inventory"

This reverts commit 6562eee763667a701d65dd74628bd2047174d84d.

There are more changes required to fix this so keep this at old state for now