Skip to content

Commit 0425a61

Browse files
committed
shared_ptr upcast fixes for D
Same changes that were applied to Java/C# in ab7f526
1 parent 6910e5f commit 0425a61

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Source/Modules/d.cxx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3378,14 +3378,16 @@ class D : public Language {
33783378
upcast_wrapper_name);
33793379

33803380
if (smart) {
3381-
SwigType *bsmart = Copy(smart);
3381+
String *smartnamestr = SwigType_namestr(smart);
3382+
String *bsmartnamestr = SwigType_namestr(smart);
3383+
33823384
SwigType *rclassname = SwigType_typedef_resolve_all(c_class_name);
33833385
SwigType *rbaseclass = SwigType_typedef_resolve_all(c_base_name);
3384-
Replaceall(bsmart, rclassname, rbaseclass);
3386+
Replaceall(bsmartnamestr, rclassname, rbaseclass);
3387+
33853388
Delete(rclassname);
33863389
Delete(rbaseclass);
3387-
String *smartnamestr = SwigType_namestr(smart);
3388-
String *bsmartnamestr = SwigType_namestr(bsmart);
3390+
33893391
Printv(upcasts_code,
33903392
"SWIGEXPORT ", bsmartnamestr, " * ", upcast_wrapper_name,
33913393
"(", smartnamestr, " *objectRef) {\n",
@@ -3394,7 +3396,6 @@ class D : public Language {
33943396
"\n", NIL);
33953397
Delete(bsmartnamestr);
33963398
Delete(smartnamestr);
3397-
Delete(bsmart);
33983399
} else {
33993400
Printv(upcasts_code,
34003401
"SWIGEXPORT ", c_base_name, " * ", upcast_wrapper_name,

0 commit comments

Comments
 (0)