2016-03-29 19 views
-1

バインディングソースでwindowsフォームアプリケーションを使用しています。私はInitializeComponenet()メソッドの形式で以下のコードでバインディングソースを初期化しました。私は以下のコードが正しいことを知ることができますか?Windowsフォームアプリケーションでメモリリークを検出する最も良い方法は何ですか?

private System.Windows.Forms.BindingSource bindingSource1; 
private void InitializeComponent() 
{ 
this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);; 
((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit(); 
this.SuspendLayout(); 
this.bindingSource1.DataSource = typeof(WindowsFormsApplication2.Class1); 

control.DataSource = this.bindingSource1; 
((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).EndInit(); 
this.ResumeLayout(false); 
} 

デザイナーに変更を加えた後、サンプルを実行すると、ビジュアルスタジオは応答しない状態になります。だから私はいくつかのメモリリークの問題をコントロールで疑う、どのように私はメモリリークの問題やビジュアルスタジオが問題に応答していない見つけることができますか?

+1

「応答なし」はメモリリークとは関係ありません。 – Dai

答えて

0

メモリプロファイラの使用。そのような単純な。 VSには1つあります。そして、常にmemprofilerがあります。

これは、メモリリークを見つけて分析する唯一の方法です。

関連する問題