aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/exiv2wrapper.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/exiv2wrapper.cpp b/src/exiv2wrapper.cpp
index 99f72da..ad145d1 100644
--- a/src/exiv2wrapper.cpp
+++ b/src/exiv2wrapper.cpp
@@ -43,6 +43,8 @@ namespace exiv2wrapper
void Image::_instantiate_image()
{
+ // If an exception is thrown, it has to be done outside of the
+ // Py_{BEGIN,END}_ALLOW_THREADS block.
Exiv2::Error error(0);
// Release the GIL to allow other python threads to run
@@ -88,6 +90,8 @@ Image::Image(const Image& image)
void Image::readMetadata()
{
+ // If an exception is thrown, it has to be done outside of the
+ // Py_{BEGIN,END}_ALLOW_THREADS block.
Exiv2::Error error(0);
// Release the GIL to allow other python threads to run
@@ -120,6 +124,8 @@ void Image::writeMetadata()
{
CHECK_METADATA_READ
+ // If an exception is thrown, it has to be done outside of the
+ // Py_{BEGIN,END}_ALLOW_THREADS block.
Exiv2::Error error(0);
// Release the GIL to allow other python threads to run