forked from pool/gsoap
68 lines
1.5 KiB
Diff
68 lines
1.5 KiB
Diff
References: http://sf.net/p/gsoap2/bugs/1007/
|
|
|
|
---
|
|
gsoap/stdsoap2.cpp | 28 +++++++++++++++++++++++++---
|
|
1 file changed, 25 insertions(+), 3 deletions(-)
|
|
|
|
Index: gsoap-2.8.22/gsoap/stdsoap2.cpp
|
|
===================================================================
|
|
--- gsoap-2.8.22.orig/gsoap/stdsoap2.cpp
|
|
+++ gsoap-2.8.22/gsoap/stdsoap2.cpp
|
|
@@ -7254,7 +7254,13 @@ SOAP_FMAC1
|
|
struct soap*
|
|
SOAP_FMAC2
|
|
soap_versioning(soap_new)(soap_mode imode, soap_mode omode)
|
|
-{ struct soap *soap = (struct soap*)malloc(sizeof(struct soap));
|
|
+{
|
|
+#ifdef __cplusplus
|
|
+ struct soap *soap = new struct soap;
|
|
+#else
|
|
+ struct soap *soap = malloc(sizeof(struct soap));
|
|
+ soap->dummy = NULL;
|
|
+#endif
|
|
if (soap)
|
|
soap_versioning(soap_init)(soap, imode, omode);
|
|
return soap;
|
|
@@ -7268,7 +7274,11 @@ void
|
|
SOAP_FMAC2
|
|
soap_free(struct soap *soap)
|
|
{ soap_done(soap);
|
|
+#ifdef __cplusplus
|
|
+ SOAP_DELETE(soap);
|
|
+#else
|
|
free(soap);
|
|
+#endif
|
|
}
|
|
#endif
|
|
|
|
@@ -7278,7 +7288,12 @@ SOAP_FMAC1
|
|
void
|
|
SOAP_FMAC2
|
|
soap_del(struct soap *soap)
|
|
-{ free(soap);
|
|
+{
|
|
+#ifdef __cplusplus
|
|
+ SOAP_DELETE(soap);
|
|
+#else
|
|
+ free(soap);
|
|
+#endif
|
|
}
|
|
#endif
|
|
|
|
@@ -8981,7 +8996,14 @@ SOAP_FMAC1
|
|
struct soap*
|
|
SOAP_FMAC2
|
|
soap_copy(const struct soap *soap)
|
|
-{ return soap_copy_context((struct soap*)malloc(sizeof(struct soap)), soap);
|
|
+{
|
|
+#ifdef __cplusplus
|
|
+ return soap_copy_context(new struct soap, soap);
|
|
+#else
|
|
+ struct soap *s = malloc(sizeof(struct soap));
|
|
+ s->dummy = NULL;
|
|
+ return soap_copy_context(s, soap);
|
|
+#endif
|
|
}
|
|
#endif
|
|
|