@@ -735,6 +735,8 @@ void py_str_cb (struct tgl_state *TLSR, void *cb_extra, int success, const char
735
735
Py_XDECREF (callable );
736
736
}
737
737
738
+ #define PY_PEER_ID (x ) (tgl_peer_id_t)((tgl_Peer*)x)->peer->id
739
+
738
740
void py_do_all (void ) {
739
741
int p = 0 ;
740
742
while (p < pos ) {
@@ -744,68 +746,98 @@ void py_do_all (void) {
744
746
PyObject * args = (PyObject * )py_ptr [p ++ ];
745
747
746
748
const char * str , * str1 , * str2 , * str3 ;
749
+
750
+ Py_ssize_t i ;
751
+ tgl_user_id_t * ids ;
752
+
747
753
int len , len1 , len2 , len3 ;
748
754
int limit , offset ;
749
755
long msg_id ;
750
756
PyObject * pyObj1 = NULL ;
751
757
PyObject * pyObj2 = NULL ;
752
758
PyObject * cb_extra = NULL ;
753
759
754
- //struct tgl_message *M ;
755
- tgl_peer_id_t peer , peer1 ;
760
+ PyObject * peer = NULL ;
761
+ PyObject * peer1 = NULL ;
756
762
757
763
switch (f ) {
758
764
case pq_contact_list :
759
- PyArg_ParseTuple (args , "|O" , & cb_extra );
760
- tgl_do_update_contact_list (TLS , py_contact_list_cb , cb_extra );
765
+ if (PyArg_ParseTuple (args , "|O" , & cb_extra ))
766
+ tgl_do_update_contact_list (TLS , py_contact_list_cb , cb_extra );
767
+ else
768
+ PyErr_Print ();
761
769
break ;
762
770
case pq_dialog_list :
763
- PyArg_ParseTuple (args , "|O" , & cb_extra );
764
- tgl_do_get_dialog_list (TLS , 100 , 0 , py_dialog_list_cb , cb_extra );
771
+ if (PyArg_ParseTuple (args , "|O" , & cb_extra ))
772
+ tgl_do_get_dialog_list (TLS , 100 , 0 , py_dialog_list_cb , cb_extra );
773
+ else
774
+ PyErr_Print ();
765
775
break ;
766
776
case pq_msg :
767
- PyArg_ParseTuple (args , "iis#|O" , & peer .type , & peer .id , & str , & len , & cb_extra );
768
- tgl_do_send_message (TLS , peer , str , len , 0 , py_msg_cb , cb_extra );
777
+ if (PyArg_ParseTuple (args , "O!s#|O" , & tgl_PeerType , & peer , & str , & len , & cb_extra ))
778
+ tgl_do_send_message (TLS , PY_PEER_ID (peer ), str , len , 0 , py_msg_cb , cb_extra );
779
+ else
780
+ PyErr_Print ();
769
781
break ;
770
782
case pq_send_typing :
771
- PyArg_ParseTuple (args , "ii|O" , & peer .type , & peer .id , & cb_extra );
772
- tgl_do_send_typing (TLS , peer , tgl_typing_typing , py_empty_cb , cb_extra );
783
+ if (PyArg_ParseTuple (args , "O!|O" , & tgl_PeerType , & peer , & cb_extra ))
784
+ tgl_do_send_typing (TLS , PY_PEER_ID (peer ), tgl_typing_typing , py_empty_cb , cb_extra );
785
+ else
786
+ PyErr_Print ();
773
787
break ;
774
788
case pq_send_typing_abort :
775
- PyArg_ParseTuple (args , "ii|O" , & peer .type , & peer .id , & cb_extra );
776
- tgl_do_send_typing (TLS , peer , tgl_typing_cancel , py_empty_cb , cb_extra );
789
+ if (PyArg_ParseTuple (args , "O!|O" , & tgl_PeerType , & peer , & cb_extra ))
790
+ tgl_do_send_typing (TLS , PY_PEER_ID (peer ), tgl_typing_cancel , py_empty_cb , cb_extra );
791
+ else
792
+ PyErr_Print ();
777
793
break ;
778
794
case pq_rename_chat :
779
- PyArg_ParseTuple (args , "iis#|O" , & peer .type , & peer .id , & str , & len , & cb_extra );
780
- tgl_do_rename_chat (TLS , peer , str , len , py_empty_cb , cb_extra );
795
+ if (PyArg_ParseTuple (args , "O!s#|O" , & tgl_PeerType , & peer , & str , & len , & cb_extra ))
796
+ tgl_do_rename_chat (TLS , PY_PEER_ID (peer ), str , len , py_empty_cb , cb_extra );
797
+ else
798
+ PyErr_Print ();
781
799
break ;
782
800
case pq_send_photo :
783
- PyArg_ParseTuple (args , "iis|O" , & peer .type , & peer .id , & str , & cb_extra );
784
- tgl_do_send_document (TLS , peer , str , NULL , 0 , TGL_SEND_MSG_FLAG_DOCUMENT_PHOTO , py_msg_cb , cb_extra );
801
+ if (PyArg_ParseTuple (args , "O!s|O" , & tgl_PeerType , & peer , & str , & cb_extra ))
802
+ tgl_do_send_document (TLS , PY_PEER_ID (peer ), str , NULL , 0 , TGL_SEND_MSG_FLAG_DOCUMENT_PHOTO , py_msg_cb , cb_extra );
803
+ else
804
+ PyErr_Print ();
785
805
break ;
786
806
case pq_send_video :
787
- PyArg_ParseTuple (args , "iis|O" , & peer .type , & peer .id , & str , & cb_extra );
788
- tgl_do_send_document (TLS , peer , str , NULL , 0 , TGL_SEND_MSG_FLAG_DOCUMENT_VIDEO , py_msg_cb , cb_extra );
807
+ if (PyArg_ParseTuple (args , "O!s|O" , & tgl_PeerType , & peer , & str , & cb_extra ))
808
+ tgl_do_send_document (TLS , PY_PEER_ID (peer ), str , NULL , 0 , TGL_SEND_MSG_FLAG_DOCUMENT_VIDEO , py_msg_cb , cb_extra );
809
+ else
810
+ PyErr_Print ();
789
811
break ;
790
812
case pq_send_audio :
791
- PyArg_ParseTuple (args , "iis|O" , & peer .type , & peer .id , & str , & cb_extra );
792
- tgl_do_send_document (TLS , peer , str , NULL , 0 , TGL_SEND_MSG_FLAG_DOCUMENT_AUDIO , py_msg_cb , cb_extra );
813
+ if (PyArg_ParseTuple (args , "O!s|O" , & tgl_PeerType , & peer , & str , & cb_extra ))
814
+ tgl_do_send_document (TLS , PY_PEER_ID (peer ), str , NULL , 0 , TGL_SEND_MSG_FLAG_DOCUMENT_AUDIO , py_msg_cb , cb_extra );
815
+ else
816
+ PyErr_Print ();
793
817
break ;
794
818
case pq_send_document :
795
- PyArg_ParseTuple (args , "iis|O" , & peer .type , & peer .id , & str , & cb_extra );
796
- tgl_do_send_document (TLS , peer , str , NULL , 0 , 0 , py_msg_cb , cb_extra );
819
+ if (PyArg_ParseTuple (args , "O!s|O" , & tgl_PeerType , & peer , & str , & cb_extra ))
820
+ tgl_do_send_document (TLS , PY_PEER_ID (peer ), str , NULL , 0 , 0 , py_msg_cb , cb_extra );
821
+ else
822
+ PyErr_Print ();
797
823
break ;
798
824
case pq_send_file :
799
- PyArg_ParseTuple (args , "iis|O" , & peer .type , & peer .id , & str , & cb_extra );
800
- tgl_do_send_document (TLS , peer , str , NULL , 0 , TGL_SEND_MSG_FLAG_DOCUMENT_AUTO , py_msg_cb , cb_extra );
825
+ if (PyArg_ParseTuple (args , "O!s|O" , & tgl_PeerType , & peer , & str , & cb_extra ))
826
+ tgl_do_send_document (TLS , PY_PEER_ID (peer ), str , NULL , 0 , TGL_SEND_MSG_FLAG_DOCUMENT_AUTO , py_msg_cb , cb_extra );
827
+ else
828
+ PyErr_Print ();
801
829
break ;
802
830
case pq_send_text :
803
- PyArg_ParseTuple (args , "iis|O" , & peer .type , & peer .id , & str , & cb_extra );
804
- tgl_do_send_text (TLS , peer , str , 0 , py_msg_cb , cb_extra );
831
+ if (PyArg_ParseTuple (args , "O!s|O" , & tgl_PeerType , & peer , & str , & cb_extra ))
832
+ tgl_do_send_text (TLS , PY_PEER_ID (peer ), str , 0 , py_msg_cb , cb_extra );
833
+ else
834
+ PyErr_Print ();
805
835
break ;
806
836
case pq_chat_set_photo :
807
- PyArg_ParseTuple (args , "iis|O" , & peer .type , & peer .id , & str , & cb_extra );
808
- tgl_do_set_chat_photo (TLS , peer , str , py_empty_cb , cb_extra );
837
+ if (PyArg_ParseTuple (args , "O!s|O" , & tgl_PeerType , & peer , & str , & cb_extra ))
838
+ tgl_do_set_chat_photo (TLS , PY_PEER_ID (peer ), str , py_empty_cb , cb_extra );
839
+ else
840
+ PyErr_Print ();
809
841
break ;
810
842
/* case pq_load_photo:
811
843
case pq_load_video:
@@ -835,120 +867,175 @@ void py_do_all (void) {
835
867
break;
836
868
*/
837
869
case pq_fwd :
838
- PyArg_ParseTuple (args , "iil|O" , & peer .type , & peer .id , & msg_id , & cb_extra );
839
- tgl_do_forward_message (TLS , peer , msg_id , 0 , py_msg_cb , cb_extra );
870
+ if (PyArg_ParseTuple (args , "O!l|O" , & tgl_PeerType , & peer , & msg_id , & cb_extra ))
871
+ tgl_do_forward_message (TLS , PY_PEER_ID (peer ), msg_id , 0 , py_msg_cb , cb_extra );
872
+ else
873
+ PyErr_Print ();
840
874
break ;
841
875
case pq_fwd_media :
842
- PyArg_ParseTuple (args , "iil|O" , & peer .type , & peer .id , & msg_id , & cb_extra );
843
- tgl_do_forward_media (TLS , peer , msg_id , 0 , py_msg_cb , cb_extra );
876
+ if (PyArg_ParseTuple (args , "O!l|O" , & tgl_PeerType , & peer , & msg_id , & cb_extra ))
877
+ tgl_do_forward_media (TLS , PY_PEER_ID (peer ), msg_id , 0 , py_msg_cb , cb_extra );
878
+ else
879
+ PyErr_Print ();
844
880
break ;
845
881
case pq_chat_info :
846
- PyArg_ParseTuple (args , "ii|O" , & peer .type , & peer .id , & cb_extra );
847
- tgl_do_get_chat_info (TLS , peer , 0 , py_chat_cb , cb_extra );
882
+ if (PyArg_ParseTuple (args , "O!|O" , & tgl_PeerType , & peer , & cb_extra ))
883
+ tgl_do_get_chat_info (TLS , PY_PEER_ID (peer ), 0 , py_chat_cb , cb_extra );
884
+ else
885
+ PyErr_Print ();
848
886
break ;
849
887
case pq_user_info :
850
- PyArg_ParseTuple (args , "ii|O" , & peer .type , & peer .id , & cb_extra );
851
- tgl_do_get_user_info (TLS , peer , 0 , py_user_cb , cb_extra );
888
+ if (PyArg_ParseTuple (args , "O!|O" , & tgl_PeerType , & peer , & cb_extra ))
889
+ tgl_do_get_user_info (TLS , PY_PEER_ID (peer ), 0 , py_user_cb , cb_extra );
890
+ else
891
+ PyErr_Print ();
852
892
break ;
853
893
case pq_history :
854
- PyArg_ParseTuple (args , "iiii|O" , & peer .type , & peer .id , & offset , & limit , & cb_extra );
855
- tgl_do_get_history (TLS , peer , offset , limit , 0 , py_msg_list_cb , cb_extra );
894
+ if (PyArg_ParseTuple (args , "O!ii|O" , & tgl_PeerType , & peer , & offset , & limit , & cb_extra ))
895
+ tgl_do_get_history (TLS , PY_PEER_ID (peer ), offset , limit , 0 , py_msg_list_cb , cb_extra );
896
+ else
897
+ PyErr_Print ();
856
898
break ;
857
899
case pq_chat_add_user :
858
- PyArg_ParseTuple (args , "iiii|O" , & peer .type , & peer .id , & peer1 .type , & peer1 .id , & cb_extra );
859
- tgl_do_add_user_to_chat (TLS , peer , peer1 , 100 , py_empty_cb , cb_extra );
900
+ if (PyArg_ParseTuple (args , "O!O!|O" , & tgl_PeerType , & peer , & tgl_PeerType , & peer1 , & cb_extra ))
901
+ tgl_do_add_user_to_chat (TLS , PY_PEER_ID (peer ), PY_PEER_ID (peer1 ), 100 , py_empty_cb , cb_extra );
902
+ else
903
+ PyErr_Print ();
860
904
break ;
861
905
case pq_chat_del_user :
862
- PyArg_ParseTuple (args , "iiii|O" , & peer .type , & peer .id , & peer .type , & peer .id , & cb_extra );
863
- tgl_do_del_user_from_chat (TLS , peer , peer1 , py_empty_cb , cb_extra );
906
+ if (PyArg_ParseTuple (args , "O!O!|O" , & tgl_PeerType , & peer , & tgl_PeerType , & peer1 , & cb_extra ))
907
+ tgl_do_del_user_from_chat (TLS , PY_PEER_ID (peer ), PY_PEER_ID (peer1 ), py_empty_cb , cb_extra );
908
+ else
909
+ PyErr_Print ();
864
910
break ;
865
911
case pq_add_contact :
866
- PyArg_ParseTuple (args , "s#s#s#|O" , & str1 , & len1 , & str2 , & len2 , & str3 , & len3 , & cb_extra );
867
- tgl_do_add_contact (TLS , str1 , len1 , str2 , len2 , str3 , len3 , 0 , py_contact_list_cb , cb_extra );
912
+ if (PyArg_ParseTuple (args , "s#s#s#|O" , & str1 , & len1 , & str2 , & len2 , & str3 , & len3 , & cb_extra ))
913
+ tgl_do_add_contact (TLS , str1 , len1 , str2 , len2 , str3 , len3 , 0 , py_contact_list_cb , cb_extra );
914
+ else
915
+ PyErr_Print ();
868
916
break ;
869
917
case pq_del_contact :
870
- PyArg_ParseTuple (args , "ii|O" , & peer .type , & peer .id , & cb_extra );
871
- tgl_do_del_contact (TLS , peer , py_empty_cb , cb_extra );
918
+ if (PyArg_ParseTuple (args , "O!|O" , & tgl_PeerType , & peer , & cb_extra ))
919
+ tgl_do_del_contact (TLS , PY_PEER_ID (peer ), py_empty_cb , cb_extra );
920
+ else
921
+ PyErr_Print ();
872
922
break ;
873
923
case pq_rename_contact :
874
- PyArg_ParseTuple (args , "s#s#s#|O" , & str1 , & len1 , & str2 , & len2 , & str3 , & len3 , & cb_extra );
875
- tgl_do_add_contact (TLS , str1 , len1 , str2 , len2 , str3 , len3 , 1 , py_contact_list_cb , cb_extra );
924
+ if (PyArg_ParseTuple (args , "s#s#s#|O" , & str1 , & len1 , & str2 , & len2 , & str3 , & len3 , & cb_extra ))
925
+ tgl_do_add_contact (TLS , str1 , len1 , str2 , len2 , str3 , len3 , 1 , py_contact_list_cb , cb_extra );
926
+ else
927
+ PyErr_Print ();
876
928
break ;
877
929
case pq_search :
878
- PyArg_ParseTuple (args , "iis#|O" , & peer .type , & peer .id , & str , & len , & cb_extra );
879
- tgl_do_msg_search (TLS , peer , 0 , 0 , 40 , 0 , str , len , py_msg_list_cb , cb_extra );
930
+ if (PyArg_ParseTuple (args , "O!s#|O" , & tgl_PeerType , & peer , & str , & len , & cb_extra ))
931
+ tgl_do_msg_search (TLS , PY_PEER_ID (peer ), 0 , 0 , 40 , 0 , str , len , py_msg_list_cb , cb_extra );
932
+ else
933
+ PyErr_Print ();
880
934
break ;
881
935
case pq_global_search :
882
- PyArg_ParseTuple (args , "s#|O" , & str , & len , & cb_extra );
883
- tgl_do_msg_search (TLS , tgl_set_peer_id (TGL_PEER_UNKNOWN , 0 ), 0 , 0 , 40 , 0 , str , len , py_msg_list_cb , cb_extra );
936
+ if (PyArg_ParseTuple (args , "s#|O" , & str , & len , & cb_extra ))
937
+ tgl_do_msg_search (TLS , tgl_set_peer_id (TGL_PEER_UNKNOWN , 0 ), 0 , 0 , 40 , 0 , str , len , py_msg_list_cb , cb_extra );
938
+ else
939
+ PyErr_Print ();
884
940
break ;
885
941
case pq_mark_read :
886
- PyArg_ParseTuple (args , "ii|O" , & peer .type , & peer .id , & cb_extra );
887
- tgl_do_mark_read (TLS , peer , py_empty_cb , cb_extra );
942
+ if (PyArg_ParseTuple (args , "O!|O" , & tgl_PeerType , & peer , & cb_extra ))
943
+ tgl_do_mark_read (TLS , PY_PEER_ID (peer ), py_empty_cb , cb_extra );
944
+ else
945
+ PyErr_Print ();
888
946
break ;
889
947
case pq_set_profile_photo :
890
- PyArg_ParseTuple (args , "s|O" , & str , & cb_extra );
891
- tgl_do_set_profile_photo (TLS , str , py_empty_cb , cb_extra );
948
+ if (PyArg_ParseTuple (args , "s|O" , & str , & cb_extra ))
949
+ tgl_do_set_profile_photo (TLS , str , py_empty_cb , cb_extra );
950
+ else
951
+ PyErr_Print ();
892
952
break ;
893
953
case pq_set_profile_name :
894
- PyArg_ParseTuple (args , "s#s#|O" , & str1 , & len1 , & str2 , len2 , & cb_extra );
895
- tgl_do_set_profile_name (TLS , str1 , len1 , str2 , len2 , py_user_cb , cb_extra );
954
+ if (PyArg_ParseTuple (args , "s#s#|O" , & str1 , & len1 , & str2 , len2 , & cb_extra ))
955
+ tgl_do_set_profile_name (TLS , str1 , len1 , str2 , len2 , py_user_cb , cb_extra );
956
+ else
957
+ PyErr_Print ();
896
958
break ;
897
959
case pq_create_secret_chat :
898
- PyArg_ParseTuple (args , "ii|O" , & peer .type , & peer .id , & cb_extra );
899
- tgl_do_create_secret_chat (TLS , peer , py_secret_chat_cb , cb_extra );
960
+ if (PyArg_ParseTuple (args , "O!|O" , & tgl_PeerType , & peer , & cb_extra ))
961
+ tgl_do_create_secret_chat (TLS , PY_PEER_ID (peer ), py_secret_chat_cb , cb_extra );
962
+ else
963
+ PyErr_Print ();
900
964
break ;
901
- /*
902
965
case pq_create_group_chat :
903
- PyArg_ParseTuple(args, "Os|O", &pyObj1, str, &cb_extra);
904
- if(PyList_Check(pyObj1) {
905
- tgl_do_create_group_chat (TLS, peer, str, py_msg_cb, cb_extra);
906
- } else {
907
- logprintf("create_group_chat: Argument 1 must be a list of peers"
966
+ if (PyArg_ParseTuple (args , "O!s#|O" , & PyList_Type , & pyObj1 , & str , & len , & cb_extra )) {
967
+ if (PyList_GET_SIZE (pyObj1 ) > 2 ) {
968
+ ids = (tgl_user_id_t * )malloc (PyList_GET_SIZE (pyObj1 ) * sizeof (tgl_user_id_t ));
969
+ for (i = 0 ; i < PyList_GET_SIZE (pyObj1 ); i ++ ) {
970
+ peer = PyList_GetItem (pyObj1 , i );
971
+ * (ids + i ) = PY_PEER_ID (peer );
972
+ }
973
+ tgl_do_create_group_chat (TLS , PyList_GET_SIZE (pyObj1 ), ids , str , len , py_empty_cb , cb_extra );
974
+
975
+ tfree (ids , PyList_GET_SIZE (pyObj1 ) * sizeof (tgl_user_id_t ));
976
+ } else {
977
+ logprintf ("create_group_chat: Argument 1 must be a list of at least 3 peers" );
978
+ }
908
979
}
980
+ Py_XDECREF (pyObj1 );
909
981
break ;
910
- */
911
982
case pq_delete_msg :
912
983
case pq_restore_msg :
913
- PyArg_ParseTuple (args , "l|O" , msg_id , & cb_extra );
914
- tgl_do_delete_msg (TLS , msg_id , py_empty_cb , cb_extra );
984
+ if (PyArg_ParseTuple (args , "l|O" , msg_id , & cb_extra ))
985
+ tgl_do_delete_msg (TLS , msg_id , py_empty_cb , cb_extra );
986
+ else
987
+ PyErr_Print ();
915
988
break ;
916
989
/*
917
990
case pq_accept_secret_chat:
918
991
tgl_do_accept_encr_chat_request (TLS, py_ptr[p + 1], py_secret_chat_cb, py_ptr[p]);
919
992
break;
920
993
*/
921
994
case pq_send_contact :
922
- PyArg_ParseTuple (args , "iis#s#s#|O" , & peer .type , & peer .id , & str1 , & len1 , & str2 , & len2 , & str3 , & len3 , & cb_extra );
923
- tgl_do_send_contact (TLS , peer , str1 , len1 , str2 , len2 , str3 , len3 , 0 , py_msg_cb , cb_extra );
995
+ if (PyArg_ParseTuple (args , "O!s#s#s#|O" , & tgl_PeerType , & peer , & str1 , & len1 , & str2 , & len2 ,
996
+ & str3 , & len3 , & cb_extra ))
997
+ tgl_do_send_contact (TLS , PY_PEER_ID (peer ), str1 , len1 , str2 , len2 , str3 , len3 , 0 , py_msg_cb , cb_extra );
998
+ else
999
+ PyErr_Print ();
924
1000
break ;
925
1001
case pq_status_online :
926
- PyArg_ParseTuple (args , "|O" , & cb_extra );
927
- tgl_do_update_status (TLS , 1 , py_empty_cb , cb_extra );
1002
+ if (PyArg_ParseTuple (args , "|O" , & cb_extra ))
1003
+ tgl_do_update_status (TLS , 1 , py_empty_cb , cb_extra );
1004
+ else
1005
+ PyErr_Print ();
928
1006
break ;
929
1007
case pq_status_offline :
930
- PyArg_ParseTuple (args , "|O" , & cb_extra );
931
- tgl_do_update_status (TLS , 0 , py_empty_cb , cb_extra );
1008
+ if (PyArg_ParseTuple (args , "|O" , & cb_extra ))
1009
+ tgl_do_update_status (TLS , 0 , py_empty_cb , cb_extra );
1010
+ else
1011
+ PyErr_Print ();
932
1012
break ;
933
1013
case pq_extf :
934
- PyArg_ParseTuple (args , "s#|O" , & str , & len , & cb_extra );
935
- tgl_do_send_extf (TLS , str , len , py_str_cb , & cb_extra );
1014
+ if (PyArg_ParseTuple (args , "s#|O" , & str , & len , & cb_extra ))
1015
+ tgl_do_send_extf (TLS , str , len , py_str_cb , & cb_extra );
1016
+ else
1017
+ PyErr_Print ();
936
1018
break ;
937
1019
case pq_send_location :
938
- PyArg_ParseTuple (args , "iiOO|O" , & peer .type , & peer .id , & pyObj1 , & pyObj2 , & cb_extra );
939
- tgl_do_send_location (TLS , peer , PyFloat_AsDouble (pyObj1 ), PyFloat_AsDouble (pyObj2 ), 0 , py_msg_cb , cb_extra );
940
- Py_XDECREF (pyObj1 );
941
- Py_XDECREF (pyObj2 );
1020
+ if (PyArg_ParseTuple (args , "O!O!O!|O" , & tgl_PeerType , & peer , & PyFloat_Type , & pyObj1 , & PyFloat_Type , & pyObj2 , & cb_extra )){
1021
+ tgl_do_send_location (TLS , PY_PEER_ID (peer ),
1022
+ PyFloat_AsDouble (pyObj1 ), PyFloat_AsDouble (pyObj2 ), 0 , py_msg_cb , cb_extra );
1023
+ Py_XDECREF (pyObj1 );
1024
+ Py_XDECREF (pyObj2 );
1025
+ } else
1026
+ PyErr_Print ();
942
1027
break ;
943
1028
default :
944
1029
assert (0 );
945
1030
}
946
1031
947
1032
// Increment reference on cb_extra as it is passed on to the callback to use
948
1033
Py_XINCREF (cb_extra );
949
-
1034
+
950
1035
// Clean up any arg variables we could have used.
951
1036
//Py_XDECREF(args); // TODO: this is going negative ref and causing segfaults
1037
+ Py_XDECREF (peer );
1038
+ Py_XDECREF (peer1 );
952
1039
953
1040
}
954
1041
pos = 0 ;
0 commit comments