Add no throw option when new operation called 85/133185/1 accepted/tizen_3.0_common accepted/tizen_3.0_ivi accepted/tizen_3.0_mobile accepted/tizen_3.0_tv accepted/tizen_3.0_wearable tizen_3.0 accepted/tizen/3.0/common/20170612.121634 accepted/tizen/3.0/ivi/20170612.050014 accepted/tizen/3.0/mobile/20170612.050004 accepted/tizen/3.0/tv/20170612.050007 accepted/tizen/3.0/wearable/20170612.050011 submit/tizen_3.0/20170609.062605
authorjh8801.jung <jh8801.jung@samsung.com>
Fri, 9 Jun 2017 06:22:00 +0000 (15:22 +0900)
committerjh8801.jung <jh8801.jung@samsung.com>
Fri, 9 Jun 2017 06:22:34 +0000 (15:22 +0900)
Signed-off-by: jh8801.jung <jh8801.jung@samsung.com>
Change-Id: If04aa745453fe7ecd9c3cc6de23745be5e65502e

src/ClientChannel.cpp
src/Reader.cpp
src/SEService.cpp
src/Session.cpp

index b30e2e1..4901724 100644 (file)
@@ -205,7 +205,7 @@ namespace smartcard_service_api
 
                if (isClosed() == false) {
                        if (getSession()->getReader()->isSecureElementPresent() == true) {
-                               CallbackParam *param = new CallbackParam();
+                               CallbackParam *param = new (std::nothrow)CallbackParam();
 
                                param->instance = this;
                                param->callback = (void *)callback;
@@ -270,7 +270,7 @@ namespace smartcard_service_api
 
                if (getSession()->getReader()->isSecureElementPresent() == true) {
                        GVariant *var_command;
-                       CallbackParam *param = new CallbackParam();
+                       CallbackParam *param = new (std::nothrow)CallbackParam();
 
                        param->instance = this;
                        param->callback = (void *)callback;
index 06857ed..67cc896 100644 (file)
@@ -108,7 +108,7 @@ namespace smartcard_service_api
                                &result, &session_id, NULL, &error) == true) {
                                if (result == SCARD_ERROR_OK) {
                                        /* create new instance of channel */
-                                       session = new Session(context, this,
+                                       session = new (std::nothrow)Session(context, this,
                                                GUINT_TO_POINTER(session_id));
                                        if (session != NULL) {
                                                sessions.push_back(session);
@@ -162,7 +162,7 @@ namespace smartcard_service_api
                        &result, &handle, res, &error) == true) {
                        if (result == SCARD_ERROR_OK) {
                                /* create new instance of channel */
-                               session = new Session(reader->context, reader,
+                               session = new (std::nothrow)Session(reader->context, reader,
                                        GUINT_TO_POINTER(handle));
                                if (session != NULL) {
                                        reader->sessions.push_back(session);
@@ -194,7 +194,7 @@ namespace smartcard_service_api
                _BEGIN();
 
                if (isSecureElementPresent() == true) {
-                       CallbackParam *param = new CallbackParam();
+                       CallbackParam *param = new (std::nothrow)CallbackParam();
 
                        param->instance = this;
                        param->callback = (void *)callback;
index 6c3882f..5f7c6ba 100755 (executable)
@@ -100,14 +100,14 @@ namespace smartcard_service_api
                SEServiceListener *listener)
                throw(ErrorIO &, ErrorIllegalParameter &)
        {
-               return new SEService(user_data, listener);
+               return new (std::nothrow)SEService(user_data, listener);
        }
 
        SEService *SEService::createInstance(void *user_data,
                serviceConnected handler)
                throw(ErrorIO &, ErrorIllegalParameter &)
        {
-               return new SEService(user_data, handler);
+               return new (std::nothrow)SEService(user_data, handler);
        }
 
        void SEService::reader_inserted(GObject *source_object,
@@ -119,7 +119,7 @@ namespace smartcard_service_api
                _INFO("[MSG_NOTIFY_SE_INSERTED]");
 
                /* add readers */
-               reader = new Reader(service->context,
+               reader = new (std::nothrow)Reader(service->context,
                        reader_name, GUINT_TO_POINTER(reader_id));
 
                if (reader != NULL) {
@@ -471,7 +471,7 @@ namespace smartcard_service_api
                        SECURE_LOGD("Reader : name [%s], handle [%08x]", name, handle);
 
                        /* add readers */
-                       reader = new Reader(GUINT_TO_POINTER(this->handle), name, GUINT_TO_POINTER(handle));
+                       reader = new (std::nothrow)Reader(GUINT_TO_POINTER(this->handle), name, GUINT_TO_POINTER(handle));
                        if (reader == NULL)
                        {
                                _ERR("alloc failed");
@@ -526,7 +526,7 @@ namespace smartcard_service_api
                        SECURE_LOGD("Reader [%d] : name [%s], handle [%p]", i, name, handle);
 
                        /* add readers */
-                       reader = new Reader(context, name, handle);
+                       reader = new (std::nothrow)Reader(context, name, handle);
                        if (reader == NULL)
                        {
                                _ERR("alloc failed");
@@ -562,7 +562,7 @@ EXTERN_API se_service_h se_service_create_instance(void *user_data,
 
        try
        {
-               service = new SEService(user_data, (serviceConnected)callback);
+               service = new (std::nothrow)SEService(user_data, (serviceConnected)callback);
        }
        catch (...)
        {
@@ -580,7 +580,7 @@ EXTERN_API se_service_h se_service_create_instance_with_event_callback(
 
        try
        {
-               service = new SEService(user_data, (serviceConnected)connected);
+               service = new (std::nothrow)SEService(user_data, (serviceConnected)connected);
        }
        catch (...)
        {
@@ -597,7 +597,7 @@ EXTERN_API se_service_h se_service_create_instance_sync(void *user_data,
 
        try
        {
-               service = new SEService(user_data);
+               service = new (std::nothrow)SEService(user_data);
        }
        catch (ExceptionBase &e)
        {
index 5089a4b..01c938a 100644 (file)
@@ -172,7 +172,7 @@ namespace smartcard_service_api
                                        var_response, response);
 
                                /* create new instance of channel */
-                               channel = new ClientChannel(session->context,
+                               channel = new (std::nothrow)ClientChannel(session->context,
                                        session, channel_id,
                                        response, GUINT_TO_POINTER(channel_id));
                                if (channel != NULL) {
@@ -290,7 +290,7 @@ namespace smartcard_service_api
 
                if (getReader()->isSecureElementPresent() == true) {
                        if (atr.isEmpty() == true) {
-                               CallbackParam *param = new CallbackParam();
+                               CallbackParam *param = new (std::nothrow)CallbackParam();
 
                                param->instance = this;
                                param->callback = (void *)callback;
@@ -360,7 +360,7 @@ namespace smartcard_service_api
                        closed = true;
                        closeChannels();
 
-                       CallbackParam *param = new CallbackParam();
+                       CallbackParam *param = new (std::nothrow)CallbackParam();
 
                        param->instance = this;
                        param->callback = (void *)callback;
@@ -424,7 +424,7 @@ namespace smartcard_service_api
                                                var_response, response);
 
                                        /* create new instance of channel */
-                                       channel = new ClientChannel(context,
+                                       channel = new (std::nothrow)ClientChannel(context,
                                                this, channel_number,
                                                response, GUINT_TO_POINTER(channel_id));
                                        if (channel != NULL) {
@@ -461,7 +461,7 @@ namespace smartcard_service_api
                if (getReader()->isSecureElementPresent() == true) {
                        GVariant *var_aid;
 
-                       CallbackParam *param = new CallbackParam();
+                       CallbackParam *param = new (std::nothrow)CallbackParam();
 
                        param->instance = this;
                        param->callback = (void *)callback;