Fix 'cg' RCore's double-free issue