From 6b6eca1559adf64940361cc99c904d334cc0aa27 Mon Sep 17 00:00:00 2001 From: Dirk Farin Date: Wed, 23 Oct 2024 17:12:06 +0200 Subject: [PATCH] rewrite comment --- libheif/api/libheif/heif.h | 6 ++++-- libheif/init.cc | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/libheif/api/libheif/heif.h b/libheif/api/libheif/heif.h index 38d88cc50c..7cd173348a 100644 --- a/libheif/api/libheif/heif.h +++ b/libheif/api/libheif/heif.h @@ -562,8 +562,10 @@ struct heif_error heif_init(struct heif_init_params*); * * You should call heif_init() when you start using libheif and heif_deinit() when you are finished. * These calls are reference counted. Each call to heif_init() should be matched by one call to heif_deinit(). - * Note: heif_deinit() must not be called after exit(), for example in a global C++ object's destructor, otherwise - * global variables in libheif might have already been released during this function call. + * + * Note: heif_deinit() must not be called after exit(), for example in a global C++ object's destructor. + * If you do, global variables in libheif might have already been released when heif_deinit() is running, + * leading to a crash. * * \sa heif_init() */ diff --git a/libheif/init.cc b/libheif/init.cc index bbd5f6c4af..f26e2d5f95 100644 --- a/libheif/init.cc +++ b/libheif/init.cc @@ -131,8 +131,8 @@ struct heif_error heif_init(struct heif_init_params*) #endif } - // Note: it is important that we increase the counter AFTER initialization such that 'load_plugins_if_not_initialized_yet()' can check this - // without having to lock the mutex. + // Note: it is important that we increase the counter AFTER initialization such that + // 'load_plugins_if_not_initialized_yet()' can check this without having to lock the mutex. heif_library_initialization_count++; return {heif_error_Ok, heif_suberror_Unspecified, Error::kSuccess}; @@ -146,7 +146,7 @@ void heif_deinit() #endif if (heif_library_initialization_count == 0) { - // This case should never happen (heif_deinit() is called more often then heif_init()). + // This case should never happen (heif_deinit() is called more often than heif_init()). return; }