From d152cf4555c5a0e4c7a8136bfb4b8dfcbb11b653 Mon Sep 17 00:00:00 2001 From: Olivier Tilloy Date: Fri, 21 Sep 2012 09:14:57 +0200 Subject: Instantiate the exiv2_version tuple inside the boost module declaration. This fixes a segmentation fault when exiting the python interpreter. --- src/exiv2wrapper_python.cpp | 12 +++++------- 1 file 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 + * Copyright (C) 2006-2012 Olivier Tilloy * * 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(&translateExiv2Error); -- cgit