Commits

Marcus von Appen  committed e65b323

- fixed issue #30: invoke SDL_DelHintCallback() with the correct arguments
to remove the callback

  • Participants
  • Parent commits 9b32fcf

Comments (0)

Files changed (1)

File sdl2/test/hints_test.py

             data = cast(userdata, c_char_p)
             calls.append((data.value, name, oldval, newval))
         hintcb = hints.SDL_HintCallback(callback)
+        udata = c_char_p("banana")
         hints.SDL_AddHintCallback(hints.SDL_HINT_ALLOW_TOPMOST, hintcb,
-                                  b"banana")
+                                  udata)
         # SDL_AddHintCallback invokes the callback once.
         self.assertEqual(len(calls), 1)
         self.assertEqual(calls[0], (b"banana", hints.SDL_HINT_ALLOW_TOPMOST,
         self.assertEqual(calls[1], (b"banana", hints.SDL_HINT_ALLOW_TOPMOST,
                                     None, b"true"))
         hints.SDL_DelHintCallback(hints.SDL_HINT_ALLOW_TOPMOST, hintcb,
-                                  b"banana")
+                                  udata)
         hints.SDL_SetHint(hints.SDL_HINT_ALLOW_TOPMOST, b"false")
         self.assertEqual(len(calls), 2)