Create the callbacks hash on first use.
[ruby-evas.git] / src / rb_evas_object_events.c
index becdee9895798fe06a5aa523de7b2e961dc8fe36..1d465a7474b98243a7496fbec9a2a3b74338668c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: rb_evas_object_events.c 285 2005-03-15 18:00:50Z tilman $
+ * $Id: rb_evas_object_events.c 302 2005-03-22 17:41:35Z tilman $
  *
  * Copyright (C) 2005 Tilman Sauerbeck (tilman at code-monkey de)
  *
@@ -47,6 +47,9 @@
 \
        if (!rb_block_given_p ()) \
                return Qnil; \
+\
+       if (NIL_P (e->callbacks)) \
+               e->callbacks = rb_hash_new (); \
 \
        rb_hash_aset (e->callbacks, rb_str_new2 (#name), \
                      rb_block_proc ()); \