Update license to be GPLv2 or later.
Merge branch 'release_30' into release_31

Update license to be GPLv2 or later.
Don't allocate TEvent on the heap.

It is not necessary and it fixes various memory leaks.