Fixed memory leaks.
Merge remote-tracking branch 'origin/master'

Conflicts:
	src/events.h