I want to create a collection class that can collect any type of data (string, int, float). So I decided to use a List<object> structure to store any kind of data.
Since using a List structure is safer (managed) than creating an unmanaged array, I want to create a List structure so it can hold any kind of data... but I have some concerns that if I create a List<object> structure and try to hold some strings, there could be memory leaks because of string type..
So do I have to do somethings after using (emptying) the List and deallocate the strings individualy or does .Net already handle that...
Is there a nicer method for creating general collection class?
stringtype will result in a memory leak in .Net? .Net will handle the deallocation and cleanup of memory on your behalf and in this circumstance you do not need to consider it.string[]), it's not "unmanaged". The garbage collector manages the array.