[BUG] PlayerGameKeys catches an exception regardless of whether it was thrown

EK.IceFlake

  • Hero Member
  • "We are the champions my fellahs" - Sufyan/VK.SuFy
  • Posts: 1,761

.

  • VC:MP Beta Tester
  • .
  • Posts: 1,804
.

EK.IceFlake

  • Hero Member
  • "We are the champions my fellahs" - Sufyan/VK.SuFy
  • Posts: 1,761

.

  • VC:MP Beta Tester
  • .
  • Posts: 1,804
Quote from EK.IceFlake on July 9th, 2017, 03:59 PM
:edit: Figured it out. It happens when I .Disconnect my event handler. All further calls to it cause an error.
I did try my best to make the signals and slots implementation immune to issues caused by modifications during emission. But I guess this was only valid when I was doing it just with C++. When Squirrel was added to the mix, it had to mess up something. Not the first time Squirrel does goes nasty.

If you happen to come across further information that can lead you to make an example which reproduces the issue. Feel free to report back here so I can look into it.
.

EK.IceFlake

  • Hero Member
  • "We are the champions my fellahs" - Sufyan/VK.SuFy
  • Posts: 1,761
Quote from . on July 9th, 2017, 05:47 PM
Quote from EK.IceFlake on July 9th, 2017, 03:59 PM
:edit: Figured it out. It happens when I .Disconnect my event handler. All further calls to it cause an error.
I did try my best to make the signals and slots implementation immune to issues caused by modifications during emission. But I guess this was only valid when I was doing it just with C++. When Squirrel was added to the mix, it had to mess up something. Not the first time Squirrel does goes nasty.

If you happen to come across further information that can lead you to make an example which reproduces the issue. Feel free to report back here so I can look into it.
Code: [Select]
local event = function (a, b) { };
player.On.GameKeys.Connect(event);
player.On.GameKeys.Disconnect(event);