Solving memory leak in javascript with try-finally

In my previous post, I discussed how return statement is executed in try-finally clause. So in following program: string str = "original string"; try { return str; } finally { str = "changed in finally"; } the original value will be returned instead of the value changed in finally block. Would this feature be useful anywhere? Well, I can’t find anything in C#, but I can think up an example in javascript. First, let’s have a look of following javascrip code: function createDiv() { var div = document.createElement("div"); ......

Posted On Saturday, November 29, 2008 11:59 AM | Comments (8)

Debug into .Net Framework Source Code

I was writing some WPF testing code today. It was extremely simple code which just programmatically creates a Rectangle and adds it to a canvas. The code this something like this: Rectangle rectangle = new Rectangle { Fill = new SolidColorBrush(Colors.Blue), Stroke = new SolidColorBrush(Colors.Blue), Width = 150, Height = 120 }; rectangle.SetValue(Canvas.L... 100); rectangle.SetValue(Canvas.T... 100); canvas.Children.Add(rectang... However, I got an exception on rectangle.SetValue(Canvas.L... ......

Posted On Thursday, September 11, 2008 6:53 AM | Comments (1)

Copyright © Changhong Fu

Design by Bartosz Brzezinski

Design by Phil Haack Based On A Design By Bartosz Brzezinski