From: huiyu,eun Date: Tue, 14 Nov 2017 10:49:20 +0000 (+0900) Subject: [Tizen] fix crash caused by callback null X-Git-Tag: accepted/tizen/unified/20171117.124956~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=48ced15a295d2e4bf7b693708a876d8770c36058;p=platform%2Fcore%2Fuifw%2Fdali-csharp-binder.git [Tizen] fix crash caused by callback null This reverts commit c91328bf41c143a9618e04a501b7bea525db257e. Change-Id: I5989681e06c64125f5700169a56f298c0b13a33f --- diff --git a/dali-csharp-binder/src/common.h b/dali-csharp-binder/src/common.h old mode 100644 new mode 100755 index 9f8d237..2418cf4 --- a/dali-csharp-binder/src/common.h +++ b/dali-csharp-binder/src/common.h @@ -144,85 +144,17 @@ typedef struct SWIG_CSharpExceptionArgumentCallback_t callback; } SWIG_CSharpExceptionArgument_t; -static SWIG_CSharpException_t SWIG_csharp_exceptions[] = -{ - { SWIG_CSharpApplicationException, NULL }, - { SWIG_CSharpArithmeticException, NULL }, - { SWIG_CSharpDivideByZeroException, NULL }, - { SWIG_CSharpIndexOutOfRangeException, NULL }, - { SWIG_CSharpInvalidCastException, NULL }, - { SWIG_CSharpInvalidOperationException, NULL }, - { SWIG_CSharpIOException, NULL }, - { SWIG_CSharpNullReferenceException, NULL }, - { SWIG_CSharpOutOfMemoryException, NULL }, - { SWIG_CSharpOverflowException, NULL }, - { SWIG_CSharpSystemException, NULL } -}; +extern SWIG_CSharpException_t SWIG_csharp_exceptions[]; -static SWIG_CSharpExceptionArgument_t SWIG_csharp_exceptions_argument[] = -{ - { SWIG_CSharpArgumentException, NULL }, - { SWIG_CSharpArgumentNullException, NULL }, - { SWIG_CSharpArgumentOutOfRangeException, NULL } -}; +extern SWIG_CSharpExceptionArgument_t SWIG_csharp_exceptions_argument[]; -static void SWIGUNUSED SWIG_CSharpSetPendingException(SWIG_CSharpExceptionCodes code, const char *msg) -{ - SWIG_CSharpExceptionCallback_t callback = SWIG_csharp_exceptions[SWIG_CSharpApplicationException].callback; - if ((size_t)code < sizeof(SWIG_csharp_exceptions)/sizeof(SWIG_CSharpException_t)) - { - callback = SWIG_csharp_exceptions[code].callback; - } - callback(msg); -} +extern void SWIGUNUSED SWIG_CSharpSetPendingException(SWIG_CSharpExceptionCodes code, const char *msg); + +extern void SWIGUNUSED SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpExceptionArgumentCodes code, const char *msg, const char *param_name); + +extern void SWIG_CSharpException(int code, const char *msg); -static void SWIGUNUSED SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpExceptionArgumentCodes code, const char *msg, const char *param_name) { - SWIG_CSharpExceptionArgumentCallback_t callback = SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentException].callback; - if ((size_t)code < sizeof(SWIG_csharp_exceptions_argument)/sizeof(SWIG_CSharpExceptionArgument_t)) { - callback = SWIG_csharp_exceptions_argument[code].callback; - } - callback(msg, param_name); -} -SWIGINTERN void SWIG_CSharpException(int code, const char *msg) -{ - if (code == SWIG_ValueError) - { - SWIG_CSharpExceptionArgumentCodes exception_code = SWIG_CSharpArgumentOutOfRangeException; - SWIG_CSharpSetPendingExceptionArgument(exception_code, msg, 0); - } - else - { - SWIG_CSharpExceptionCodes exception_code = SWIG_CSharpApplicationException; - switch(code) - { - case SWIG_MemoryError: - exception_code = SWIG_CSharpOutOfMemoryException; - break; - case SWIG_IndexError: - exception_code = SWIG_CSharpIndexOutOfRangeException; - break; - case SWIG_DivisionByZero: - exception_code = SWIG_CSharpDivideByZeroException; - break; - case SWIG_IOError: - exception_code = SWIG_CSharpIOException; - break; - case SWIG_OverflowError: - exception_code = SWIG_CSharpOverflowException; - break; - case SWIG_RuntimeError: - case SWIG_TypeError: - case SWIG_SyntaxError: - case SWIG_SystemError: - case SWIG_UnknownError: - default: - exception_code = SWIG_CSharpApplicationException; - break; - } - SWIG_CSharpSetPendingException(exception_code, msg); - } -} #include diff --git a/dali-csharp-binder/src/dali_wrap.cpp b/dali-csharp-binder/src/dali_wrap.cpp index 3cb7dc2..88a36d7 100755 --- a/dali-csharp-binder/src/dali_wrap.cpp +++ b/dali-csharp-binder/src/dali_wrap.cpp @@ -204,7 +204,7 @@ typedef struct { SWIG_CSharpExceptionArgumentCallback_t callback; } SWIG_CSharpExceptionArgument_t; -static SWIG_CSharpException_t SWIG_csharp_exceptions[] = { +SWIG_CSharpException_t SWIG_csharp_exceptions[] = { { SWIG_CSharpApplicationException, NULL }, { SWIG_CSharpArithmeticException, NULL }, { SWIG_CSharpDivideByZeroException, NULL }, @@ -218,13 +218,13 @@ static SWIG_CSharpException_t SWIG_csharp_exceptions[] = { { SWIG_CSharpSystemException, NULL } }; -static SWIG_CSharpExceptionArgument_t SWIG_csharp_exceptions_argument[] = { +SWIG_CSharpExceptionArgument_t SWIG_csharp_exceptions_argument[] = { { SWIG_CSharpArgumentException, NULL }, { SWIG_CSharpArgumentNullException, NULL }, { SWIG_CSharpArgumentOutOfRangeException, NULL } }; -static void SWIGUNUSED SWIG_CSharpSetPendingException(SWIG_CSharpExceptionCodes code, const char *msg) { +void SWIGUNUSED SWIG_CSharpSetPendingException(SWIG_CSharpExceptionCodes code, const char *msg) { SWIG_CSharpExceptionCallback_t callback = SWIG_csharp_exceptions[SWIG_CSharpApplicationException].callback; if ((size_t)code < sizeof(SWIG_csharp_exceptions)/sizeof(SWIG_CSharpException_t)) { callback = SWIG_csharp_exceptions[code].callback; @@ -232,7 +232,7 @@ static void SWIGUNUSED SWIG_CSharpSetPendingException(SWIG_CSharpExceptionCodes callback(msg); } -static void SWIGUNUSED SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpExceptionArgumentCodes code, const char *msg, const char *param_name) { +void SWIGUNUSED SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpExceptionArgumentCodes code, const char *msg, const char *param_name) { SWIG_CSharpExceptionArgumentCallback_t callback = SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentException].callback; if ((size_t)code < sizeof(SWIG_csharp_exceptions_argument)/sizeof(SWIG_CSharpExceptionArgument_t)) { callback = SWIG_csharp_exceptions_argument[code].callback; @@ -378,7 +378,7 @@ namespace Swig { } -SWIGINTERN void SWIG_CSharpException(int code, const char *msg) { +void SWIG_CSharpException(int code, const char *msg) { if (code == SWIG_ValueError) { SWIG_CSharpExceptionArgumentCodes exception_code = SWIG_CSharpArgumentOutOfRangeException; SWIG_CSharpSetPendingExceptionArgument(exception_code, msg, 0);