Click here to Skip to main content
15,921,382 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: ShellExecute Pin
Anonymous27-Jun-03 1:20
Anonymous27-Jun-03 1:20 
GeneralRe: ShellExecute Pin
basementman27-Jun-03 3:53
basementman27-Jun-03 3:53 
GeneralRe: ShellExecute Pin
Rage27-Jun-03 4:37
professionalRage27-Jun-03 4:37 
Generalquestion about STL list Pin
zecodela26-Jun-03 23:55
zecodela26-Jun-03 23:55 
GeneralRe: question about STL list Pin
zecodela27-Jun-03 0:01
zecodela27-Jun-03 0:01 
GeneralRe: question about STL list Pin
Joaquín M López Muñoz27-Jun-03 0:42
Joaquín M López Muñoz27-Jun-03 0:42 
GeneralRe: question about STL list Pin
zecodela27-Jun-03 0:52
zecodela27-Jun-03 0:52 
GeneralRe: question about STL list Pin
Joaquín M López Muñoz27-Jun-03 2:58
Joaquín M López Muñoz27-Jun-03 2:58 
You must carefully distinguish between storing objects or pointers to objects. In the first case, pop_back is all that it takes to prevent leaks. In the second case, it is your responsibility to delete manually the pointer, as in this piece of code:
list<control *> ctrllist; // note the *
void addtolist()
{
  control* a=new control;
  a->id=1; a->value=10;
  ctrllist.push_back(a);
}
void removelist() // removes last element of ctrllist
{
  if(ctrllist.empty())return;
  control* a=ctrllist.back();
  ctrllist.pop_back();
  delete a;
}

Your first snippet of code seems to imply that what you're storing are actual objects instead of pointers, so you shouldn't need to worry about these issues.


Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
GeneralSerial port question Pin
andyg.10126-Jun-03 23:14
andyg.10126-Jun-03 23:14 
GeneralRe: Serial port question Pin
Anonymous27-Jun-03 0:31
Anonymous27-Jun-03 0:31 
GeneralRe: Serial port question Pin
andyg.10127-Jun-03 0:35
andyg.10127-Jun-03 0:35 
GeneralRe: Serial port question Pin
Anonymous27-Jun-03 1:25
Anonymous27-Jun-03 1:25 
GeneralRe: Serial port question Pin
Trollslayer27-Jun-03 1:37
mentorTrollslayer27-Jun-03 1:37 
GeneralRe: Serial port question Pin
andyg.10127-Jun-03 3:11
andyg.10127-Jun-03 3:11 
GeneralVC++ 6.0 Vs VC++.Net Pin
Shiva Prasad T. S.26-Jun-03 21:00
Shiva Prasad T. S.26-Jun-03 21:00 
GeneralRe: VC++ 6.0 Vs VC++.Net Pin
Toni7826-Jun-03 21:26
Toni7826-Jun-03 21:26 
GeneralRe: VC++ 6.0 Vs VC++.Net Pin
Kannan Kalyanaraman26-Jun-03 23:40
Kannan Kalyanaraman26-Jun-03 23:40 
GeneralRe: VC++ 6.0 Vs VC++.Net Pin
John M. Drescher27-Jun-03 3:42
John M. Drescher27-Jun-03 3:42 
GeneralFILE* into a char* Pin
Jerome Conus26-Jun-03 20:55
Jerome Conus26-Jun-03 20:55 
GeneralRe: FILE* into a char* Pin
Ryan Binns26-Jun-03 21:20
Ryan Binns26-Jun-03 21:20 
GeneralRe: FILE* into a char* Pin
basementman27-Jun-03 4:01
basementman27-Jun-03 4:01 
GeneralRe: FILE* into a char* Pin
Ryan Binns27-Jun-03 4:07
Ryan Binns27-Jun-03 4:07 
GeneralProblem with WM_COMMAND Pin
anshumanshinde26-Jun-03 20:35
anshumanshinde26-Jun-03 20:35 
GeneralRe: Problem with WM_COMMAND Pin
Ryan Binns26-Jun-03 20:42
Ryan Binns26-Jun-03 20:42 
GeneralRe: Problem with WM_COMMAND Pin
anshumanshinde26-Jun-03 21:02
anshumanshinde26-Jun-03 21:02 

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.