Core/Scripts: Fix invalid memory write

Fix invalid memory write caused by calling "delete this;" in a base class constructor.
Merge remote-tracking branch 'origin/master' into 4.3.4