ext/RMagick/rmmain.c in rmagick-2.14.0 vs ext/RMagick/rmmain.c in rmagick-2.15.0

- old
+ new

@@ -129,11 +129,11 @@ * No Ruby usage (internal function) */ void Init_RMagick2(void) { - volatile VALUE observable; + VALUE observable; MagickCoreGenesis("RMagick", MagickFalse); test_Magick_version(); @@ -858,10 +858,13 @@ ENUMERATOR(UndefinedAlphaChannel) ENUMERATOR(ActivateAlphaChannel) ENUMERATOR(DeactivateAlphaChannel) ENUMERATOR(ResetAlphaChannel) /* deprecated */ ENUMERATOR(SetAlphaChannel) +#if defined(HAVE_ENUM_REMOVEALPHACHANNEL) + ENUMERATOR(RemoveAlphaChannel) +#endif #if defined(HAVE_ENUM_COPYALPHACHANNEL) ENUMERATOR(CopyAlphaChannel) ENUMERATOR(ExtractAlphaChannel) ENUMERATOR(OpaqueAlphaChannel) ENUMERATOR(ShapeAlphaChannel) @@ -1615,10 +1618,11 @@ SetFatalErrorHandler(rm_fatal_error_handler); SetErrorHandler(rm_error_handler); SetWarningHandler(rm_warning_handler); + RB_GC_GUARD(observable); } @@ -1676,11 +1680,11 @@ */ static void version_constants(void) { const char *mgk_version; - volatile VALUE str; + VALUE str; char long_version[1000]; mgk_version = GetMagickVersion(NULL); str = rb_str_new2(mgk_version); @@ -1701,10 +1705,11 @@ str = rb_str_new2(long_version); rb_obj_freeze(str); rb_define_const(Module_Magick, "Long_version", str); + RB_GC_GUARD(str); } /** * Create Features constant. @@ -1712,11 +1717,11 @@ * No Ruby usage (internal function) */ static void features_constant(void) { - volatile VALUE features; + VALUE features; #if defined(HAVE_GETMAGICKFEATURES) // 6.5.7 - latest (7.0.0) features = rb_str_new2(GetMagickFeatures()); #elif defined(MagickFeatures) @@ -1729,6 +1734,8 @@ features = rb_str_new("unknown", 7); #endif rb_obj_freeze(features); rb_define_const(Module_Magick, "Magick_features", features); + + RB_GC_GUARD(features); }