@@ -505,50 +505,6 @@ pgRWops_FromFileObject(PyObject *obj)
505505 return rw ;
506506}
507507
508- static int
509- pgRWops_ReleaseObject (SDL_RWops * context )
510- {
511- int ret = 0 ;
512- if (pgRWops_IsFileObject (context )) {
513- #ifdef WITH_THREAD
514- PyGILState_STATE state = PyGILState_Ensure ();
515- #endif /* WITH_THREAD */
516-
517- pgRWHelper * helper = (pgRWHelper * )context -> hidden .unknown .data1 ;
518- PyObject * fileobj = helper -> file ;
519- /* 5 helper functions */
520- Py_ssize_t filerefcnt = Py_REFCNT (fileobj ) - 1 - 5 ;
521-
522- if (filerefcnt ) {
523- Py_XDECREF (helper -> seek );
524- Py_XDECREF (helper -> tell );
525- Py_XDECREF (helper -> write );
526- Py_XDECREF (helper -> read );
527- Py_XDECREF (helper -> close );
528- Py_DECREF (fileobj );
529- PyMem_Free (helper );
530- SDL_FreeRW (context );
531- }
532- else {
533- ret = SDL_RWclose (context );
534- if (ret < 0 ) {
535- PyErr_SetString (PyExc_IOError , SDL_GetError ());
536- Py_DECREF (fileobj );
537- }
538- }
539-
540- #ifdef WITH_THREAD
541- PyGILState_Release (state );
542- #endif /* WITH_THREAD */
543- }
544- else {
545- ret = SDL_RWclose (context );
546- if (ret < 0 )
547- PyErr_SetString (PyExc_IOError , SDL_GetError ());
548- }
549- return ret ;
550- }
551-
552508static Sint64
553509_pg_rw_seek (SDL_RWops * context , Sint64 offset , int whence )
554510{
@@ -894,7 +850,6 @@ MODINIT_DEFINE(rwobject)
894850 c_api [2 ] = pg_EncodeFilePath ;
895851 c_api [3 ] = pg_EncodeString ;
896852 c_api [4 ] = pgRWops_FromFileObject ;
897- c_api [5 ] = pgRWops_ReleaseObject ;
898853 apiobj = encapsulate_api (c_api , "rwobject" );
899854 if (PyModule_AddObject (module , PYGAMEAPI_LOCAL_ENTRY , apiobj )) {
900855 Py_XDECREF (apiobj );
0 commit comments