Patch memory leak from ROOT tree objects

Added a function that deletes the objects read from the ROOT tree.
Added a call to this function from the root_event_loop.