Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Red OOP on function exit

2 visualizaciones (últimos 30 días)
Martin Dowie
Martin Dowie el 23 de Jun. de 2015
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
I have a customer vector class (it's a 'bounded vector') object on my stack and when the function end ('}'), I get a red OOP error, the context pop-up suggests there are 2 calls to the dtor from this class. This seems wrong...the stack object should just be destroyed.
  2 comentarios
Mukul Rao
Mukul Rao el 24 de Jun. de 2015
Can you provide more details, attach some code? It is very difficult to relate to the question at this stage.
Martin Dowie
Martin Dowie el 25 de Jun. de 2015
Sorry, no I can't (confidential) but I think I've solved it - there was an error in the copy-ctor, where it updated a member data (the 'count') before the check for self-assignment. I think Polyspace was considering this value to be uninitialized after the copy if self-assignment was happening, e.g. via a pair of aliases into the unit under test - but given that at some point the only ctor would have to have been called and that initializes the value, so it can't actually happen.

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by