@@ -32,9 +32,14 @@ typedef struct _LDClientSDK* LDClientSDK;
3232/**
3333 * Constructs a new client-side LaunchDarkly SDK from a configuration and
3434 * context.
35- * @param config The configuration. Must not be NULL.
36- * @param context The initial context. Must not be NULL.
37- * @return New SDK instance.
35+ * @param config The configuration. Ownership is transferred. Do not free or
36+ * access the LDClientConfig in any way after this call; behavior is undefined.
37+ * Must not be NULL.
38+ * @param context The initial context. Ownership is transferred. Do not free or
39+ * access the LDContext in any way after this call; behavior is undefined. Must
40+ * not be NULL.
41+ * @return New SDK instance. Must be freed with LDClientSDK_Free when no longer
42+ * needed.
3843 */
3944LD_EXPORT (LDClientSDK )
4045LDClientSDK_New (LDClientConfig config , LDContext context );
@@ -135,7 +140,9 @@ LD_EXPORT(void) LDClientSDK_TrackEvent(LDClientSDK sdk, char const* event_name);
135140 * feature in numeric custom metrics, and will also be returned as part of the
136141 * custom event for Data Export.
137142 * @param data A JSON value containing additional data associated with the
138- * event. Must not be NULL.
143+ * event. Ownership is transferred. Do not free or
144+ * access the LDValue in any way after this call; behavior is undefined. Must
145+ * not be NULL.
139146 */
140147LD_EXPORT (void )
141148LDClientSDK_TrackMetric (LDClientSDK sdk ,
@@ -149,7 +156,9 @@ LDClientSDK_TrackMetric(LDClientSDK sdk,
149156 * @param sdk SDK. Must not be NULL.
150157 * @param event_name Must not be NULL.
151158 * @param data A JSON value containing additional data associated with the
152- * event. Must not be NULL.
159+ * event. Do not free or
160+ * access the LDValue in any way after this call; behavior is undefined. Must
161+ * not be NULL.
153162 */
154163LD_EXPORT (void )
155164LDClientSDK_TrackData (LDClientSDK sdk , char const * event_name , LDValue data );
@@ -354,7 +363,8 @@ LDClientSDK_DoubleVariationDetail(LDClientSDK sdk,
354363 * Returns the JSON value of a feature flag for a given flag key.
355364 * @param sdk SDK. Must not be NULL.
356365 * @param flag_key The unique key for the feature flag. Must not be NULL.
357- * @param default_value The default value of the flag. The value is copied.
366+ * @param default_value The default value of the flag. Ownership is retained by
367+ * the caller; a copy is made internally. Must not be NULL.
358368 * @return The variation for the current context, or a copy of default_value if
359369 * the flag is disabled in the LaunchDarkly control panel. The returned value
360370 * must be freed using LDValue_Free.
@@ -369,7 +379,8 @@ LDClientSDK_JsonVariation(LDClientSDK sdk,
369379 * that also describes the way the value was determined.
370380 * @param sdk SDK. Must not be NULL.
371381 * @param flag_key The unique key for the feature flag. Must not be NULL.
372- * @param default_value The default value of the flag. The value is copied.
382+ * @param default_value The default value of the flag. Ownership is retained by
383+ * the caller; a copy is made internally. Must not be NULL.
373384 * @param detail Out parameter to store the details. May pass LD_DISCARD_DETAILS
374385 * or NULL to discard the details. The details object must be freed with
375386 * LDEvalDetail_Free.
@@ -402,7 +413,7 @@ LDClientSDK_JsonVariationDetail(LDClientSDK sdk,
402413 * }
403414 * @endcode
404415 * @param sdk SDK. Must not be NULL.
405- * @return Value of type Object.
416+ * @return Value of type Object. Must be freed with LDValue_Free.
406417 */
407418LD_EXPORT (LDValue )
408419LDClientSDK_AllFlags (LDClientSDK sdk );
0 commit comments