Skip to content

Commit d9b1f34

Browse files
luval-microsoftluis-valverde-ms
authored andcommitted
Remove all pointer data on input module deactivation
1 parent b7f4d75 commit d9b1f34

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Assets/MixedRealityToolkit.Services/InputSystem/MixedRealityInputModule.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,11 @@ public override void DeactivateModule()
7777
{
7878
MixedRealityToolkit.InputSystem.Unregister(gameObject);
7979

80-
foreach (IMixedRealityInputSource inputSource in MixedRealityToolkit.InputSystem.DetectedInputSources)
80+
foreach (var p in pointerDataToUpdate)
8181
{
82-
OnSourceLost(inputSource);
82+
pointerDataToRemove.Add(p.Value);
8383
}
84+
pointerDataToUpdate.Clear();
8485

8586
// Process once more to handle pointer removals.
8687
Process();
@@ -281,11 +282,8 @@ void OnSourceDetected(IMixedRealityInputSource inputSource)
281282

282283
void IMixedRealitySourceStateHandler.OnSourceLost(SourceStateEventData eventData)
283284
{
284-
OnSourceLost(eventData.InputSource);
285-
}
285+
var inputSource = eventData.InputSource;
286286

287-
void OnSourceLost(IMixedRealityInputSource inputSource)
288-
{
289287
for (int i = 0; i < inputSource.Pointers.Length; i++)
290288
{
291289
var pointer = inputSource.Pointers[i];

0 commit comments

Comments
 (0)