Updated latest post because of errors

The code examples included a rather serious memory leak. This has now been fixed.