forked from pool/gsoap
40 lines
1.1 KiB
Diff
40 lines
1.1 KiB
Diff
|
---
|
||
|
gsoap/stdsoap2.cpp | 17 +++++++++++++++--
|
||
|
1 file changed, 15 insertions(+), 2 deletions(-)
|
||
|
|
||
|
Index: gsoap-2.8.22/gsoap/stdsoap2.cpp
|
||
|
===================================================================
|
||
|
--- gsoap-2.8.22.orig/gsoap/stdsoap2.cpp
|
||
|
+++ gsoap-2.8.22/gsoap/stdsoap2.cpp
|
||
|
@@ -7256,7 +7256,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;
|
||
|
@@ -8983,7 +8989,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
|
||
|
|