Home Help Center

About Classes transmit

levellevel Member ✭✭
In .ice

...

class other
{
...
};
class mainobj
{
otherobj other;
};


sequence<mainobj>mainobjlist;


interface transmiter
{
void push(mainobjlist ol);
};
...

When I call the push function that transmit the mainobj sequence from client to server ,Is the memory leak.

Comments

  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    It is impossible for us to help you with the information you provide. Please provide as much detail as possible:

    - Which operating system you are using
    - Which compiler you are using
    - Which versions of the above you are using
    - Which version of Ice you are using
    - The server side code segment
    - The client side code segement
    - How do you detect the memory leak
    - Any other information that may be relevant
  • levellevel Member ✭✭
    win2003,ice1.4,vc2003

    I just doubt.

    Before ,I find if a object(class) donot manage with main program and they will be memory leak.That is ,In main program ,I push the object in the sequecne that will clear before the program end;This object usually is a part of another more large class . Just like other for mainobj.


    class other
    {
    ...
    };
    class mainobj
    {
    otherobj other;
    };


    sequence<mainobj>mainobjlist;


    interface transmiter
    {
    void push(mainobjlist ol);
    };


    In program ,I always push the mainobj in sequence and clear before the progam end ,in order to prevent memroy leak, the same to class other.
    Note,the above take place in client or server.My question is ,when I transmit the mainobj sequence from one to another node(server or client) ,in another program,the class other object donot clear manual,so I just doubt the memory leak will be.
    Of course,the vc2003 debuger do not tell me the memory leak happen .
  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    Sorry, but I'm afraid I still don't understand the problem. What code causes a memory leak, and how do you detect that there is indeed a memory leak? Or are you concerned about a theoretical memory leak because you don't do manual cleanup in your code? If so, you don't need to be concerned, the Ice smart pointers for object instances take care of cleanup, meaning that as long as all smart pointers are cleaned up, the objects they refer to are cleaned up as well.
  • levellevel Member ✭✭
    In my program I am userd to manager the class_ptr object( class one) in sequence (std::vector).When the program end ,I will clear this sequence manual. In this way ,the debuger do not tell the memory leak .Since I manage some class_ptr ,If I donot manage another classptr( class two) in sequence ,debuger will report memmory leak, If I do ,debuger will not.And that usually the another classptr( class two) is a part of some classptr(class one).
    Just like class another for class one


    class another
    {
    ...
    };

    class one
    {
    another aa;
    };
Sign In or Register to comment.