Browse Source

obs_data: Fix wrong data queried for release

On release of obs_data, if the default/autoselect values pointed toward
a sub-object or a sub-array, it would look up the data for the regular
user value.  (Palana must have forgot to change these functions around
when adding the default/autoselect functionality)
jp9000 11 years ago
parent
commit
fe13f59e3d
1 changed files with 4 additions and 4 deletions
  1. 4 4
      libobs/obs-data.c

+ 4 - 4
libobs/obs-data.c

@@ -137,7 +137,7 @@ static inline obs_data_t get_item_default_obj(struct obs_data_item *item)
 	if (!item || !item->default_size)
 		return NULL;
 
-	return *(obs_data_t*)get_item_data(item);
+	return *(obs_data_t*)get_default_data_ptr(item);
 }
 
 static inline obs_data_t get_item_autoselect_obj(struct obs_data_item *item)
@@ -145,7 +145,7 @@ static inline obs_data_t get_item_autoselect_obj(struct obs_data_item *item)
 	if (!item || !item->autoselect_size)
 		return NULL;
 
-	return *(obs_data_t*)get_item_data(item);
+	return *(obs_data_t*)get_autoselect_data_ptr(item);
 }
 
 static inline obs_data_array_t get_item_array(struct obs_data_item *item)
@@ -162,7 +162,7 @@ static inline obs_data_array_t get_item_default_array(
 	if (!item || !item->default_size)
 		return NULL;
 
-	return *(obs_data_array_t*)get_item_data(item);
+	return *(obs_data_array_t*)get_default_data_ptr(item);
 }
 
 static inline obs_data_array_t get_item_autoselect_array(
@@ -171,7 +171,7 @@ static inline obs_data_array_t get_item_autoselect_array(
 	if (!item || !item->autoselect_size)
 		return NULL;
 
-	return *(obs_data_array_t*)get_item_data(item);
+	return *(obs_data_array_t*)get_autoselect_data_ptr(item);
 }
 
 static inline void item_data_release(struct obs_data_item *item)