@@ -809,18 +809,22 @@ void NotepadPlusWrapper::activateBufferID(int bufferID)
809809}
810810boost::python::str NotepadPlusWrapper::getBufferFilename (int bufferID)
811811{
812+ GILRelease release;
812813 TCHAR buffer[MAX_PATH];
813814 callNotepad (NPPM_GETFULLPATHFROMBUFFERID, static_cast <WPARAM>(bufferID), reinterpret_cast <LPARAM>(buffer));
814815 std::shared_ptr<char > filename = WcharMbcsConverter::tchar2char (buffer);
816+ release.reacquire ();
815817 return boost::python::str (const_cast <const char *>(filename.get ()));
816818}
817819
818820boost::python::str NotepadPlusWrapper::getCurrentFilename ()
819821{
822+ GILRelease release;
820823 idx_t bufferID = callNotepad (NPPM_GETCURRENTBUFFERID);
821824 TCHAR buffer[MAX_PATH];
822825 callNotepad (NPPM_GETFULLPATHFROMBUFFERID, bufferID, reinterpret_cast <LPARAM>(buffer));
823826 std::shared_ptr<char > filename = WcharMbcsConverter::tchar2char (buffer);
827+ release.reacquire ();
824828 return boost::python::str (const_cast <const char *>(filename.get ()));
825829}
826830
@@ -872,7 +876,9 @@ bool NotepadPlusWrapper::runMenuCommand(boost::python::str menuName, boost::pyth
872876boost::python::str NotepadPlusWrapper::getNppDir ()
873877{
874878 TCHAR buffer[MAX_PATH];
879+ GILRelease release;
875880 ::SendMessage (m_nppHandle, NPPM_GETNPPDIRECTORY, MAX_PATH, reinterpret_cast <LPARAM>(buffer));
881+ release.reacquire ();
876882 return boost::python::str (const_cast <const char *>(WcharMbcsConverter::tchar2char (buffer).get ()));
877883}
878884
@@ -883,13 +889,16 @@ boost::python::str NotepadPlusWrapper::getCommandLine()
883889
884890bool NotepadPlusWrapper::allocateSupported ()
885891{
892+ GILRelease release;
886893 return 1 == ::SendMessage (m_nppHandle, NPPM_ALLOCATESUPPORTED, 0 , 0 );
887894}
888895
889896boost::python::object NotepadPlusWrapper::allocateCmdID (int quantity)
890897{
891898 int startID;
899+ GILRelease release;
892900 bool result = 1 == ::SendMessage (m_nppHandle, NPPM_ALLOCATECMDID, static_cast <WPARAM>(quantity), reinterpret_cast <LPARAM>(&startID));
901+ release.reacquire ();
893902 if (result)
894903 {
895904 return boost::python::object (startID);
@@ -903,7 +912,9 @@ boost::python::object NotepadPlusWrapper::allocateCmdID(int quantity)
903912boost::python::object NotepadPlusWrapper::allocateMarker (int quantity)
904913{
905914 int startID;
915+ GILRelease release;
906916 bool result = 1 == ::SendMessage (m_nppHandle, NPPM_ALLOCATEMARKER, static_cast <WPARAM>(quantity), reinterpret_cast <LPARAM>(&startID));
917+ release.reacquire ();
907918 if (result)
908919 {
909920 return boost::python::object (startID);
0 commit comments