comparison Sources/Autogenerated/sdk_OrthancPluginIdentifierConstraint.impl.h @ 128:5b59ebc267e1 fix-leak

fixed leaks in the initialization of the enums
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 30 Aug 2023 11:02:20 +0200
parents eb6ac5a801d1
children c55b0583084b
comparison
equal deleted inserted replaced
127:a862d554753f 128:5b59ebc267e1
62 * "Class attributes can be added by setting the tp_dict to a 62 * "Class attributes can be added by setting the tp_dict to a
63 * dictionary with these attributes before calling PyType_Ready() 63 * dictionary with these attributes before calling PyType_Ready()
64 * (in your module initialization function)." 64 * (in your module initialization function)."
65 **/ 65 **/
66 66
67 PyDict_SetItemString(sdk_OrthancPluginIdentifierConstraint_Type.tp_dict, "EQUAL", PyLong_FromLong(1)); 67 {
68 PyDict_SetItemString(sdk_OrthancPluginIdentifierConstraint_Type.tp_dict, "SMALLER_OR_EQUAL", PyLong_FromLong(2)); 68 PyObject* tmp = PyLong_FromLong(1);
69 PyDict_SetItemString(sdk_OrthancPluginIdentifierConstraint_Type.tp_dict, "GREATER_OR_EQUAL", PyLong_FromLong(3)); 69 PyDict_SetItemString(sdk_OrthancPluginIdentifierConstraint_Type.tp_dict, "EQUAL", tmp);
70 PyDict_SetItemString(sdk_OrthancPluginIdentifierConstraint_Type.tp_dict, "WILDCARD", PyLong_FromLong(4)); 70 Py_DECREF(tmp);
71 }
72
73 {
74 PyObject* tmp = PyLong_FromLong(2);
75 PyDict_SetItemString(sdk_OrthancPluginIdentifierConstraint_Type.tp_dict, "SMALLER_OR_EQUAL", tmp);
76 Py_DECREF(tmp);
77 }
78
79 {
80 PyObject* tmp = PyLong_FromLong(3);
81 PyDict_SetItemString(sdk_OrthancPluginIdentifierConstraint_Type.tp_dict, "GREATER_OR_EQUAL", tmp);
82 Py_DECREF(tmp);
83 }
84
85 {
86 PyObject* tmp = PyLong_FromLong(4);
87 PyDict_SetItemString(sdk_OrthancPluginIdentifierConstraint_Type.tp_dict, "WILDCARD", tmp);
88 Py_DECREF(tmp);
89 }
90
71 91
72 Py_INCREF(&sdk_OrthancPluginIdentifierConstraint_Type); 92 Py_INCREF(&sdk_OrthancPluginIdentifierConstraint_Type);
73 if (PyModule_AddObject(module, "IdentifierConstraint", (PyObject *)&sdk_OrthancPluginIdentifierConstraint_Type) < 0) 93 if (PyModule_AddObject(module, "IdentifierConstraint", (PyObject *)&sdk_OrthancPluginIdentifierConstraint_Type) < 0)
74 { 94 {
75 OrthancPlugins::LogError("Cannot register Python enumeration: OrthancPluginIdentifierConstraint"); 95 OrthancPlugins::LogError("Cannot register Python enumeration: OrthancPluginIdentifierConstraint");