Skip to content

Commit 2247a7e

Browse files
Ensure ImageFactory is only used as a static class
1 parent 3b28dd1 commit 2247a7e

File tree

3 files changed

+8
-88
lines changed

3 files changed

+8
-88
lines changed

src/interface/image.i

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@ EXIV2_DEPRECATED(Exiv2::Image::supportsMetadata)
245245
%ignore Exiv2::NativePreview;
246246
%ignore Exiv2::NativePreviewList;
247247
%ignore Exiv2::Image::nativePreviews;
248+
%ignore Exiv2::ImageFactory::ImageFactory;
249+
%ignore Exiv2::ImageFactory::~ImageFactory;
248250
%ignore isBigEndianPlatform;
249251
%ignore isLittleEndianPlatform;
250252
%ignore isStringType;

src/swig-0_27_7/image_wrap.cxx

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7020,36 +7020,6 @@ SWIGINTERN PyObject *_wrap_ImageFactory_createIo(PyObject *self, PyObject *args)
70207020
}
70217021

70227022

7023-
SWIGINTERN PyObject *_wrap_delete_ImageFactory(PyObject *self, PyObject *args) {
7024-
PyObject *resultobj = 0;
7025-
Exiv2::ImageFactory *arg1 = (Exiv2::ImageFactory *) 0 ;
7026-
void *argp1 = 0 ;
7027-
int res1 = 0 ;
7028-
7029-
if (!SWIG_Python_UnpackTuple(args, "delete_ImageFactory", 0, 0, 0)) SWIG_fail;
7030-
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Exiv2__ImageFactory, SWIG_POINTER_DISOWN | 0 );
7031-
if (!SWIG_IsOK(res1)) {
7032-
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ImageFactory" "', argument " "1"" of type '" "Exiv2::ImageFactory *""'");
7033-
}
7034-
arg1 = reinterpret_cast< Exiv2::ImageFactory * >(argp1);
7035-
{
7036-
try {
7037-
delete arg1;
7038-
}
7039-
catch(std::exception const& e) {
7040-
_set_python_exception();
7041-
SWIG_fail;
7042-
}
7043-
}
7044-
resultobj = SWIG_Py_Void();
7045-
return resultobj;
7046-
fail:
7047-
return NULL;
7048-
}
7049-
7050-
7051-
SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete_ImageFactory) /* defines _wrap_delete_ImageFactory_destructor_closure */
7052-
70537023
static PyMethodDef SwigMethods[] = {
70547024
{ "enableBMFF", _wrap_enableBMFF, METH_VARARGS, "\n"
70557025
"Enable BMFF support.\n"
@@ -7933,7 +7903,7 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__ImageFactory_type = {
79337903
"exiv2.image.ImageFactory", /* tp_name */
79347904
sizeof(SwigPyObject), /* tp_basicsize */
79357905
0, /* tp_itemsize */
7936-
_wrap_delete_ImageFactory_destructor_closure, /* tp_dealloc */
7906+
SwigPyBuiltin_BadDealloc, /* tp_dealloc */
79377907
#if PY_VERSION_HEX < 0x030800b4
79387908
(printfunc) 0, /* tp_print */
79397909
#else
@@ -8165,7 +8135,7 @@ static PyTypeObject *SwigPyBuiltin__Exiv2__ImageFactory_type_create(PyTypeObject
81658135
};
81668136
PyType_Slot slots[] = {
81678137
{ Py_tp_init, (void *)SwigPyBuiltin_BadInit },
8168-
{ Py_tp_dealloc, (void *)_wrap_delete_ImageFactory_destructor_closure },
8138+
{ Py_tp_dealloc, (void *)SwigPyBuiltin_BadDealloc },
81698139
{ Py_tp_alloc, (void *)(allocfunc) 0 },
81708140
{ Py_tp_free, (void *)(freefunc) 0 },
81718141
{ Py_tp_is_gc, (void *)(inquiry) 0 },

src/swig-0_28_7/image_wrap.cxx

Lines changed: 4 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -7078,58 +7078,6 @@ SWIGINTERN PyObject *_wrap_ImageFactory_createIo(PyObject *self, PyObject *args)
70787078
}
70797079

70807080

7081-
SWIGINTERN int _wrap_new_ImageFactory(PyObject *self, PyObject *args, PyObject *kwargs) {
7082-
PyObject *resultobj = 0;
7083-
Exiv2::ImageFactory *result = 0 ;
7084-
7085-
if (!SWIG_Python_CheckNoKeywords(kwargs, "new_ImageFactory")) SWIG_fail;
7086-
if (!SWIG_Python_UnpackTuple(args, "new_ImageFactory", 0, 0, 0)) SWIG_fail;
7087-
{
7088-
try {
7089-
result = (Exiv2::ImageFactory *)new Exiv2::ImageFactory();
7090-
}
7091-
catch(std::exception const& e) {
7092-
_set_python_exception();
7093-
SWIG_fail;
7094-
}
7095-
}
7096-
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Exiv2__ImageFactory, SWIG_BUILTIN_INIT | 0 );
7097-
return resultobj == Py_None ? -1 : 0;
7098-
fail:
7099-
return -1;
7100-
}
7101-
7102-
7103-
SWIGINTERN PyObject *_wrap_delete_ImageFactory(PyObject *self, PyObject *args) {
7104-
PyObject *resultobj = 0;
7105-
Exiv2::ImageFactory *arg1 = (Exiv2::ImageFactory *) 0 ;
7106-
void *argp1 = 0 ;
7107-
int res1 = 0 ;
7108-
7109-
if (!SWIG_Python_UnpackTuple(args, "delete_ImageFactory", 0, 0, 0)) SWIG_fail;
7110-
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Exiv2__ImageFactory, SWIG_POINTER_DISOWN | 0 );
7111-
if (!SWIG_IsOK(res1)) {
7112-
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ImageFactory" "', argument " "1"" of type '" "Exiv2::ImageFactory *""'");
7113-
}
7114-
arg1 = reinterpret_cast< Exiv2::ImageFactory * >(argp1);
7115-
{
7116-
try {
7117-
delete arg1;
7118-
}
7119-
catch(std::exception const& e) {
7120-
_set_python_exception();
7121-
SWIG_fail;
7122-
}
7123-
}
7124-
resultobj = SWIG_Py_Void();
7125-
return resultobj;
7126-
fail:
7127-
return NULL;
7128-
}
7129-
7130-
7131-
SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete_ImageFactory) /* defines _wrap_delete_ImageFactory_destructor_closure */
7132-
71337081
static PyMethodDef SwigMethods[] = {
71347082
{ "enableBMFF", _wrap_enableBMFF, METH_VARARGS, "\n"
71357083
"Enable BMFF support.\n"
@@ -8004,7 +7952,7 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__ImageFactory_type = {
80047952
"exiv2.image.ImageFactory", /* tp_name */
80057953
sizeof(SwigPyObject), /* tp_basicsize */
80067954
0, /* tp_itemsize */
8007-
_wrap_delete_ImageFactory_destructor_closure, /* tp_dealloc */
7955+
SwigPyBuiltin_BadDealloc, /* tp_dealloc */
80087956
#if PY_VERSION_HEX < 0x030800b4
80097957
(printfunc) 0, /* tp_print */
80107958
#else
@@ -8051,7 +7999,7 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__ImageFactory_type = {
80517999
(descrgetfunc) 0, /* tp_descr_get */
80528000
(descrsetfunc) 0, /* tp_descr_set */
80538001
offsetof(SwigPyObject, dict), /* tp_dictoffset */
8054-
_wrap_new_ImageFactory, /* tp_init */
8002+
SwigPyBuiltin_BadInit, /* tp_init */
80558003
(allocfunc) 0, /* tp_alloc */
80568004
(newfunc) 0, /* tp_new */
80578005
(freefunc) 0, /* tp_free */
@@ -8235,8 +8183,8 @@ static PyTypeObject *SwigPyBuiltin__Exiv2__ImageFactory_type_create(PyTypeObject
82358183
{ NULL, 0, 0, 0, NULL }
82368184
};
82378185
PyType_Slot slots[] = {
8238-
{ Py_tp_init, (void *)_wrap_new_ImageFactory },
8239-
{ Py_tp_dealloc, (void *)_wrap_delete_ImageFactory_destructor_closure },
8186+
{ Py_tp_init, (void *)SwigPyBuiltin_BadInit },
8187+
{ Py_tp_dealloc, (void *)SwigPyBuiltin_BadDealloc },
82408188
{ Py_tp_alloc, (void *)(allocfunc) 0 },
82418189
{ Py_tp_free, (void *)(freefunc) 0 },
82428190
{ Py_tp_is_gc, (void *)(inquiry) 0 },

0 commit comments

Comments
 (0)