]> granicus.if.org Git - icu/commitdiff
ICU-10700 From Markus' review comments.
authorTravis Keep <keep94@gmail.com>
Tue, 11 Mar 2014 21:18:34 +0000 (21:18 +0000)
committerTravis Keep <keep94@gmail.com>
Tue, 11 Mar 2014 21:18:34 +0000 (21:18 +0000)
X-SVN-Rev: 35408

icu4c/source/i18n/unicode/calendar.h
icu4c/source/i18n/unicode/translit.h

index c7e221d711a4366ca593287e2f4d013c123498e5..6ef85095d5814866c298873f5cb4b39d8b9773c3 100644 (file)
@@ -2348,6 +2348,11 @@ private:
     /**
      * Register a new Calendar factory.  The factory will be adopted.
      * INTERNAL in 2.6
+     *
+     * Because ICU may choose to cache Calendars internally, this must
+     * be called at application startup, prior to any calls to
+     * Calendar::createInstance to avoid undefined behavior.
+     *
      * @param toAdopt the factory instance to be adopted
      * @param status the in/out status code, no special meanings are assigned
      * @return a registry key that can be used to unregister this factory
@@ -2361,6 +2366,10 @@ private:
      * The CalendarFactory corresponding to the key will be deleted.
      * INTERNAL in 2.6
      * @param key the registry key returned by a previous call to registerFactory
+     * Because ICU may choose to cache Calendars internally, this should
+     * be called during application shutdown, after all calls to
+     * Calendar::createInstance to avoid undefined behavior.
+     *
      * @param status the in/out status code, no special meanings are assigned
      * @return TRUE if the factory for the key was successfully unregistered
      * @internal
index 469e94316d9e30c1c0c789beaf020221bcd42b68..4973d424715a05e9674fb18ef44b0b0419a7f41e 100644 (file)
@@ -1,6 +1,6 @@
 /*
 **********************************************************************
-* Copyright (C) 1999-2013, International Business Machines
+* Copyright (C) 1999-2014, International Business Machines
 * Corporation and others. All Rights Reserved.
 **********************************************************************
 *   Date        Name        Description
@@ -965,6 +965,11 @@ public:
     /**
      * Registers a factory function that creates transliterators of
      * a given ID.
+     *
+     * Because ICU may choose to cache Transliterators internally, this must
+     * be called at application startup, prior to any calls to
+     * Transliterator::createXXX to avoid undefined behavior.
+     *
      * @param id the ID being registered
      * @param factory a function pointer that will be copied and
      * called later when the given ID is passed to createInstance()
@@ -987,6 +992,10 @@ public:
      * After this call the Transliterator class owns the adoptedObj
      * and will delete it.
      *
+     * Because ICU may choose to cache Transliterators internally, this must
+     * be called at application startup, prior to any calls to
+     * Transliterator::createXXX to avoid undefined behavior.
+     *
      * @param adoptedObj an instance of subclass of
      * <code>Transliterator</code> that defines <tt>clone()</tt>
      * @see #createInstance
@@ -1085,6 +1094,10 @@ public:
      * Any attempt to construct an unregistered transliterator based
      * on its ID will fail.
      *
+     * Because ICU may choose to cache Transliterators internally, this should
+     * be called during application shutdown, after all calls to
+     * Transliterator::createXXX to avoid undefined behavior.
+     *
      * @param ID the ID of the transliterator or class
      * @return the <code>Object</code> that was registered with
      * <code>ID</code>, or <code>null</code> if none was