Skip to content

Commit

Permalink
rewrite comment
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Oct 23, 2024
1 parent 4da075f commit 6b6eca1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions libheif/api/libheif/heif.h
Original file line number Diff line number Diff line change
Expand Up @@ -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()
*/
Expand Down
6 changes: 3 additions & 3 deletions libheif/init.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -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;
}

Expand Down

0 comments on commit 6b6eca1

Please sign in to comment.