MRI-Binding: Catch exceptions in clone constructors

This commit is contained in:
Jonas Kulla 2013-10-31 10:25:54 +01:00
parent b7a2ba830c
commit 3359451f3a
1 changed files with 3 additions and 1 deletions

View File

@ -204,7 +204,9 @@ rb_bool_new(bool value)
if (!OBJ_INIT_COPY(self, orig)) /* When would this fail??*/\
return self; \
Klass *k = getPrivateData<Klass>(orig); \
setPrivateData(self, new Klass(*k)); \
Klass *dup; \
GUARD_EXC( dup = new Klass(*k); ) \
setPrivateData(self, dup); \
return self; \
}