Windows 8 Runtime: Break circular dependencies

Underneath there is some code snippet from one of the SDK samples. Be aware of circular dependencies, get familiar with weak pointers!

auto view = ref new View();
view->Initialize(m_window, m_applicationView);
view->Run();

// Must delete the view explicitly in order to break a circular dependency
// between View and CoreWindow. View holds on to a CoreWindow reference most
// typically for window activation, while CoreWindow refers back to View when
// event handlers are hooked up. Without breaking this circular dependency,
// neither View nor CoreWindow object gets to clean up. It's also important
// to note that a 'delete' call on a ref class instance simply means calling
// into a class destructor in order to explicitly break a cycle. It doesn't
// actually deallocate any memory.
delete view;