~osomon/pyexiv2/pyexiv2-0.3

« back to all changes in this revision

Viewing changes to src/exiv2wrapper_python.cpp

  • Committer: Olivier Tilloy
  • Date: 2012-09-21 07:20:37 UTC
  • mfrom: (375.1.1 pyexiv2)
  • Revision ID: olivier@tilloy.net-20120921072037-k8l7tyq4l3wedas8
Instantiate the exiv2_version tuple inside the boost module declaration.
This fixes a segmentation fault when exiting the python interpreter.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// *****************************************************************************
2
2
/*
3
 
 * Copyright (C) 2006-2010 Olivier Tilloy <olivier@tilloy.net>
 
3
 * Copyright (C) 2006-2012 Olivier Tilloy <olivier@tilloy.net>
4
4
 *
5
5
 * This file is part of the pyexiv2 distribution.
6
6
 *
34
34
 
35
35
using namespace exiv2wrapper;
36
36
 
37
 
boost::python::tuple exiv2_version = \
38
 
    boost::python::make_tuple(EXIV2_MAJOR_VERSION,
39
 
                              EXIV2_MINOR_VERSION,
40
 
                              EXIV2_PATCH_VERSION);
41
 
 
42
37
BOOST_PYTHON_MODULE(libexiv2python)
43
38
{
44
 
    scope().attr("exiv2_version_info") = exiv2_version;
 
39
    scope().attr("exiv2_version_info") = \
 
40
        boost::python::make_tuple(EXIV2_MAJOR_VERSION,
 
41
                                  EXIV2_MINOR_VERSION,
 
42
                                  EXIV2_PATCH_VERSION);
45
43
 
46
44
    register_exception_translator<Exiv2::Error>(&translateExiv2Error);
47
45