aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2012-09-21 09:14:57 +0200
committerOlivier Tilloy <olivier@tilloy.net>2012-09-21 09:14:57 +0200
commitd152cf4555c5a0e4c7a8136bfb4b8dfcbb11b653 (patch)
tree0cba1dcd60852fd86cd587551e7e02e772751e9b
parent7e7cb325f942582a43602d460dac4c8e47fdc002 (diff)
downloadpyexiv2-d152cf4555c5a0e4c7a8136bfb4b8dfcbb11b653.tar.gz
Instantiate the exiv2_version tuple inside the boost module declaration.
This fixes a segmentation fault when exiting the python interpreter.
-rw-r--r--src/exiv2wrapper_python.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/exiv2wrapper_python.cpp b/src/exiv2wrapper_python.cpp
index 3a09a0c..3fe1ce5 100644
--- a/src/exiv2wrapper_python.cpp
+++ b/src/exiv2wrapper_python.cpp
@@ -1,6 +1,6 @@
// *****************************************************************************
/*
- * Copyright (C) 2006-2010 Olivier Tilloy <olivier@tilloy.net>
+ * Copyright (C) 2006-2012 Olivier Tilloy <olivier@tilloy.net>
*
* This file is part of the pyexiv2 distribution.
*
@@ -34,14 +34,12 @@ using namespace boost::python;
using namespace exiv2wrapper;
-boost::python::tuple exiv2_version = \
- boost::python::make_tuple(EXIV2_MAJOR_VERSION,
- EXIV2_MINOR_VERSION,
- EXIV2_PATCH_VERSION);
-
BOOST_PYTHON_MODULE(libexiv2python)
{
- scope().attr("exiv2_version_info") = exiv2_version;
+ scope().attr("exiv2_version_info") = \
+ boost::python::make_tuple(EXIV2_MAJOR_VERSION,
+ EXIV2_MINOR_VERSION,
+ EXIV2_PATCH_VERSION);
register_exception_translator<Exiv2::Error>(&translateExiv2Error);