add brief sentence ('in bytes') 25/58625/2 accepted/tizen/ivi/20160218.022820 accepted/tizen/mobile/20160203.101925 accepted/tizen/tv/20160203.101938 accepted/tizen/wearable/20160203.101959 submit/tizen/20160203.051417 submit/tizen_common/20160218.142243 submit/tizen_ivi/20160217.000000 submit/tizen_ivi/20160217.000001
authorHyihong Chae <hh.chae@samsung.com>
Tue, 2 Feb 2016 08:48:11 +0000 (17:48 +0900)
committerHyihong Chae <hh.chae@samsung.com>
Tue, 2 Feb 2016 23:12:08 +0000 (15:12 -0800)
add remove routine of event-callback glist at deinitialized.

Change-Id: I15112289361882b3409a4e39b41bbf25b191ff18
Signed-off-by: HyiHong Chae <hh.chae@samsung.com>
include/mtp.h
src/mtp.c
src/mtp_gdbus_manager.c

index 333d17c..47aa322 100755 (executable)
@@ -508,12 +508,12 @@ int mtp_deviceinfo_get_device_version(mtp_device_h mtp_device, char **device_ver
 int mtp_storageinfo_get_description(mtp_device_h mtp_device, mtp_storage_h mtp_storage, char **description);
 
 /**
- * @brief Gets the free space of the storage information.
+ * @brief Gets the free space of the storage information in bytes.
  * @since_tizen 3.0
  *
  * @param [in] mtp_device The MTP device
  * @param [in] mtp_storage The MTP storage
- * @param [out] free_space The free space of Storage information
+ * @param [out] free_space The free space of Storage information (bytes)
  *
  * @return 0 on success, otherwise a negative error value.
  * @retval #MTP_ERROR_NONE Successful
@@ -532,12 +532,12 @@ int mtp_storageinfo_get_description(mtp_device_h mtp_device, mtp_storage_h mtp_s
 int mtp_storageinfo_get_free_space(mtp_device_h mtp_device, mtp_storage_h mtp_storage, unsigned long long *free_space);
 
 /**
- * @brief Gets the max capacity of the storage information.
+ * @brief Gets the max capacity of the storage information in bytes.
  * @since_tizen 3.0
  *
  * @param [in] mtp_device The MTP device
  * @param [in] mtp_storage The MTP storage
- * @param [out] max_capacity The max capacity of Storage information
+ * @param [out] max_capacity The max capacity of Storage information (bytes)
  *
  * @return 0 on success, otherwise a negative error value.
  * @retval #MTP_ERROR_NONE Successful
index be028be..7d4109f 100755 (executable)
--- a/src/mtp.c
+++ b/src/mtp.c
@@ -314,6 +314,7 @@ int mtp_deinitialize(void)
 
        if (__is_initialized == true && ref_count == 0) {
                mtp_db_deinit();
+               mtp_gdbus_manager_remove_all_event_cb();
                ret = mtp_gdbus_manager_deinitialize();
                __is_initialized = false;
        }
index e7be1ac..a34e654 100755 (executable)
@@ -95,6 +95,14 @@ mtp_error_e mtp_gdbus_manager_remove_event_cb(mtp_event_cb callback)
        return MTP_ERROR_NONE;
 }
 
+mtp_error_e mtp_gdbus_manager_remove_all_event_cb(void)
+{
+       g_slist_free_full(event_cb_list, g_free);
+       event_cb_list = NULL;
+
+       return MTP_ERROR_NONE;
+}
+
 mtp_error_e mtp_gdbus_manager_initialize(void)
 {
        mtp_error_e result = MTP_ERROR_NONE;