Click here to Skip to main content
15,890,845 members
Home / Discussions / C#
   

C#

 
GeneralRe: to return or not to return something Pin
Rob Philpott17-Mar-08 6:20
Rob Philpott17-Mar-08 6:20 
GeneralRe: to return or not to return something Pin
Simon P Stevens17-Mar-08 6:55
Simon P Stevens17-Mar-08 6:55 
GeneralRe: to return or not to return something [modified] Pin
pauli17-Mar-08 23:01
pauli17-Mar-08 23:01 
GeneralRe: to return or not to return something Pin
Simon P Stevens18-Mar-08 6:07
Simon P Stevens18-Mar-08 6:07 
Generalgeneric collection - .net 2.0 Pin
arkiboys17-Mar-08 4:22
arkiboys17-Mar-08 4:22 
GeneralRe: generic collection - .net 2.0 Pin
Luc Pattyn17-Mar-08 4:29
sitebuilderLuc Pattyn17-Mar-08 4:29 
QuestionActive Directory "login" from C# application Pin
User 137680017-Mar-08 3:52
User 137680017-Mar-08 3:52 
GeneralResource leak (handles count) in simple .NET application Pin
Kolobock17-Mar-08 3:45
Kolobock17-Mar-08 3:45 
Hi
I have a resource leak in the very simple project.
Project contains Form with one TextBox control in multiline mode.
After start this app I open Task Manager and see "Handles" count incremental on every 1 second.

The source code is following:

<code>

public partial class Form1 : Form
{
System.Threading.Timer tm;
public Form1()
{
InitializeComponent();
// start timer 1 second interval ...
tm = new System.Threading.Timer(OnTimer, null, 0, 1000);
}

void OnTimer(Object state)
{
// add text in thread safe mode ...
AddTerminalText(" Resource Leak!!! ");
}

delegate void AddTextCallback(string text);
AddTextCallback d;
object[] arg = new object[1];
private void AddTerminalText(string text)
{
if (textBox1.InvokeRequired)
{
if (d == null)
{
d = new AddTextCallback(AddTerminalText);
}
arg[0] = text;
textBox1.Invoke(d, arg);
}
else
{
textBox1.AppendText(text); // add text into control ...
}
}
}

</code>

I don't understand what's wrong Frown | :-(
Please help anybody !!!

Roman
GeneralRe: Resource leak (handles count) in simple .NET application Pin
Luc Pattyn17-Mar-08 3:55
sitebuilderLuc Pattyn17-Mar-08 3:55 
GeneralRe: Resource leak (handles count) in simple .NET application Pin
Kolobock17-Mar-08 4:07
Kolobock17-Mar-08 4:07 
GeneralRe: Resource leak (handles count) in simple .NET application Pin
Luc Pattyn17-Mar-08 4:25
sitebuilderLuc Pattyn17-Mar-08 4:25 
GeneralRe: Resource leak (handles count) in simple .NET application Pin
Kolobock17-Mar-08 8:32
Kolobock17-Mar-08 8:32 
GeneralRe: Resource leak (handles count) in simple .NET application Pin
Luc Pattyn17-Mar-08 8:44
sitebuilderLuc Pattyn17-Mar-08 8:44 
GeneralRe: Resource leak (handles count) in simple .NET application Pin
Kolobock17-Mar-08 10:18
Kolobock17-Mar-08 10:18 
GeneralRe: Resource leak (handles count) in simple .NET application Pin
Rob Philpott17-Mar-08 4:10
Rob Philpott17-Mar-08 4:10 
GeneralRe: Resource leak (handles count) in simple .NET application Pin
Kolobock17-Mar-08 8:34
Kolobock17-Mar-08 8:34 
GeneralRe: Resource leak (handles count) in simple .NET application Pin
Kolobock17-Mar-08 23:57
Kolobock17-Mar-08 23:57 
GeneralIP Camera with C# Pin
sher1217-Mar-08 3:44
sher1217-Mar-08 3:44 
GeneralRe: IP Camera with C# Pin
Luc Pattyn17-Mar-08 3:59
sitebuilderLuc Pattyn17-Mar-08 3:59 
GeneralScreen Shot Pin
sjs4u17-Mar-08 2:18
sjs4u17-Mar-08 2:18 
GeneralRe: Screen Shot Pin
ritz123417-Mar-08 2:45
ritz123417-Mar-08 2:45 
GeneralRe: Screen Shot Pin
sjs4u17-Mar-08 2:48
sjs4u17-Mar-08 2:48 
GeneralRe: Screen Shot Pin
Christian Graus17-Mar-08 9:18
protectorChristian Graus17-Mar-08 9:18 
GeneralRe: Screen Shot Pin
Kristian Sixhøj17-Mar-08 3:58
Kristian Sixhøj17-Mar-08 3:58 
GeneralUnable to start debugging a web application in VS2003 Pin
i_want_to_learn_c#17-Mar-08 1:54
i_want_to_learn_c#17-Mar-08 1:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.