marko-js-archive / marko-widgets

[LEGACY] Module to support binding of behavior to rendered UI components rendered on the server or client
http://v3.markojs.com/docs/marko-widgets/
MIT License
141 stars 40 forks source link

remove widget references after widget has been destroyed #31

Closed zeligon closed 9 years ago

zeligon commented 9 years ago

assign the widget to NULL after the widget has been destroyed.

pedramphp commented 9 years ago

this is how we used to do with backbone, I guess marko widgets is missing to remove the this reference it self.

destroy: function(){
            //COMPLETELY UNBIND THE VIEW
            this.undelegateEvents();
            this.$el.removeData().unbind(); 

            //Remove view from DOM
            this.remove();  
            Backbone.View.prototype.remove.call(this);
        }
patrick-steele-idem commented 9 years ago

There is not enough information to act on this issue. In the marko-widgets@>3.0 we dropped the this.widgets collection so no cleanup is required. In the marko-widgets@<3.0 we do remove widgets out of the this.widgets collection using the following code: https://github.com/raptorjs/marko-widgets/blob/5658cae45a85ccc5bbae4849c09a847bd687f392/lib/Widget.js#L59-L64

Can you please provide more details?

patrick-steele-idem commented 9 years ago

Doing some house cleaning. If this is still an issue please let me know, but I'm going to go ahead and close it.