Anonymous avatar Anonymous committed d229f97

null callbacks allowed

Comments (0)

Files changed (3)

             instance must not be modified.
-    def f(e):
-        return filter(e.contents.specialize())
-    _SDL_SetEventFilter(_SDL_EventFilter(f))
+    if filter:
+        def f(e):
+            return filter(e.contents.specialize())
+        _SDL_SetEventFilter(_SDL_EventFilter(f))
+    else:
+        _SDL_SetEventFilter(_SDL_EventFilter())
 SDL_GetEventFilter = SDL.dll.function('SDL_GetEventFilter',
     '''Return the current event filter.
             func(udata, stream)
         return _Mix_FilterFunc(f)
-        return None
+        return _Mix_FilterFunc()
 _Mix_SetPostMix = _dll.private_function('Mix_SetPostMix',
     arg_types=[_Mix_FilterFunc, c_void_p],
     if music_finished:
-        _Mix_HookMusicFinished(None)
+        _Mix_HookMusicFinished(_Mix_HookMusicFinishedFunc())
 # Mix_GetMusicHookData not implemented (unnecessary)
     if channel_finished:
-        _Mix_ChannelFinished(None)
+        _Mix_ChannelFinished(_Mix_ChannelFinishedFunc())
 _Mix_EffectFunc = CFUNCTYPE(None, c_int, POINTER(c_ubyte), c_int, c_void_p)
 def _make_Mix_EffectFunc(func, udata):
             func(chan, stream, udata)
         return _Mix_EffectFunc(f)
-        return None
+        return _Mix_EffectFunc()
 _Mix_EffectDoneFunc = CFUNCTYPE(None, c_int, c_void_p)
 def _make_Mix_EffectDoneFunc(func, udata):
         def f(chan, ignored):
             func(chan, udata)
         return _MixEffectDoneFunc(f)
+    else:
+        return _MixEffectDoneFunc()
 _Mix_RegisterEffect = _dll.private_function('Mix_RegisterEffect',
-dealloc surface
 mac default icon
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.