Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-127921

添加类成员vecor<int>

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Incomplete
    • P3: Somewhat important
    • None
    • 6.7.2
    • None
    • Windows

    Description

      添加类成员变量类型为vecor<int>,在成员函数中使用push_back,需要清除之后重新build,运行才能正常工作,不然,程序在运行时push_back会no such value,segmentation error,程序崩溃,如果提前reserve,仍然会no such value,但不会直接崩溃,一段时间后(可能是重新分配内存时)就会崩溃。

      而且会有奇怪的事情阻碍判断,vector<int> a, b, c;  a是添加新vector前正常运行的,b,c是之后创建的,b no such vaue,c又能正常,进行一些看似完全无关的操作后,a却不正常了。

      建议在添加vector时给个提醒,重新清除,build。

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            luoyun LUO YUN
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes